What happened in Kotlin between 1.6.10 and 16.20?
I’m unable to build my project after migration because of OutOfMemoryError.
Originally I have this setup
org.gradle.jvmargs=-Xmx8g -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -Dfile.encoding=UTF-8 kapt.use.worker.api=true
It always failed on Out of memory: Java heap space
usually on KAPT
I have no experimental setup like the parallel module compilation introduced in 1.6.20.
I tried to increase -Xmx8g
up to 16g
add -Dkotlin.daemon.jvm.options=-Xmx16g
Also removed kapt.use.worker.api=true
.
Then I tried add also kotlin.daemon.jvmargs=-Xmx16g
to gradle.properties or use kotlin.compiler.execution.strategy=in-process
, only result was change the exception to
Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
I tried also this JVM switch
-XX:+UseCompressedOops
It happens just when I build all flavors, when I build just one, usually from IDE, it works.
Is there any known memory leak in the new version of the Kotlin compiler?
Update: I update memory limits even more and build time goes over 2 hours and it ends with Execution timeout on TeamCity