mike.dev
03/12/2020, 3:47 PMOutOfMemoryError
exception.
It happens on the building phrase with this task generateDebugUnitTestStubRFile"
We have multiple modules, and OOM error occurs randomly
I can fix the issue by increasing the gradle max-heap size, but it’s not a good option because we ’re very close to the limit of the hardware.
So far, what I have tried are:
1. Update Gradle to 6.2.2
2. Tried to turn on/off grade worker API with `kapt.use.worker.api`& android.enableGradleWorkers
flags (they are off by now)
3. Play around with some testOptions flags (https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html), for example forkEvery, maxParallelForks. But I am not sure it would help, because the failure happens on the building phrase.
Here is the crash log:
Caused by: com.android.ide.common.workers.WorkerExecutorException: 1 exception was raised by workers:
java.lang.OutOfMemoryError: GC overhead limit exceeded
at com.android.ide.common.workers.ExecutorServiceAdapter.await(ExecutorServiceAdapter.kt:108)
at com.android.ide.common.workers.ExecutorServiceAdapter.close(ExecutorServiceAdapter.kt:118)
at <http://kotlin.io|kotlin.io>.CloseableKt.closeFinally(Closeable.kt:53)
The crash happened by this line of code. https://android.googlesource.com/platform/tools/base/+/studio-master-dev/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/res/GenerateLibraryRFileTask.kt#120
It will be very appreciated if anyone of you would suggest any solution or direction to investigate.
Generate a heapdump is on my planAlexey Belkov [JB]
03/16/2020, 12:42 PMmike.dev
03/31/2020, 10:27 AM