james
09/27/2022, 8:07 AMGradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
I’ve attached a screenshot of the resource usage up until the build dies.. and for some further context, when I look back at older jobs using Kotlin 1.6.21 I see their memory usage on the same graph peaks at around 65%. now it hits 100% and then dies. could this be a memory leak in the build phase? I’m not able to pull any useful logs either, even with enabling most kotlin.build.report.*
options 😕tapchicoma
09/27/2022, 8:35 AM<system_tmp>/kotlin-daemon.*.log
and probably also Gradle daemon logs here: <gradle_user_home>/daemon/<build_gradle_version>/*.log
tapchicoma
09/27/2022, 8:38 AMorg.gradle.jvmargs
and kotlin.daemon.jvmargs
additional parameter -XX:+HeapDumpOnOutOfMemoryError
james
09/27/2022, 10:25 AMHeapDumpOnOutOfMemoryError
in both gradle and kotlin daemon args lists already, but I will try and see if I can pull the logs you mentionedtapchicoma
09/27/2022, 10:52 AMjames
09/27/2022, 11:13 AM/tmp/kotlin-daemon.log
james
09/27/2022, 11:13 AM~/.gradle
nowtapchicoma
09/27/2022, 11:15 AMjames
09/27/2022, 11:16 AMtapchicoma
09/27/2022, 11:16 AMjames
09/27/2022, 11:16 AMgradle.properties
:
org.gradle.jvmargs=-XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC -Dfile.encoding=UTF-8
kotlin.daemon.jvm.options=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParallelGC
tapchicoma
09/27/2022, 11:16 AMjames
09/27/2022, 11:17 AMjames
09/27/2022, 11:19 AMtapchicoma
09/27/2022, 11:20 AMtapchicoma
09/27/2022, 11:22 AMjames
09/27/2022, 11:24 AMtapchicoma
09/27/2022, 11:24 AMtapchicoma
09/27/2022, 11:26 AMthis particular workflow uses an executor with 3 CPU / 6 GB RAMJust a guess - try to set
org.gradle.workers.max=3
and run your CI buildjames
09/27/2022, 11:40 AM2022-09-27 11:31:34.165 [compiler] INFO: getDaemonJVMOptions: DaemonJVMOptions(maxMemory=2048m, maxMetaspaceSize=, reservedCodeCacheSize=, jvmParams=[-Djava.awt.headless=true, -D$java.rmi.server.hostname=127.0.0.1, -Dkotlin.environment.keepalive, -ea, Dkotlin.environment.keepalive, ea])
that’s from the Kotlin Daemon log.. but in those options I don’t see any of my options that are set in my gradle.properties file?tapchicoma
09/27/2022, 11:57 AMtapchicoma
09/27/2022, 11:58 AMthat works! ..but.. the build takes ~10 min instead of the 6 min it previously tookEach additional worker increases required heap size. Try to play with this value and set it only for CI builds depending on the docker image parameters.