Hi guys. I am not sure here is the right channel t...
# android
m
Hi guys. I am not sure here is the right channel to ask, but could you help a question. After update to use Android Gradle Plugin 3.6.1, our unit test keeps getting
OutOfMemoryError
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:
Copy code
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 plan
a
Please report a bug to Android: https://developer.android.com/studio/report-bugs
m
hi, thanks for your advice. I already report an issue during the time asking question. https://issuetracker.google.com/u/1/issues/151460310