This message was deleted.
# performance
s
This message was deleted.
r
Have you checked the value of Total garbage collection time in the performance tab? You might see it growing
d
yes it is growing a bit, like 30 second
btw i just realized now my build spawn new gradle workers
Im using gradle 8, with JDK 17, but it spawn worker with jdk 11
🤔 1
r
There are multiple things here 😅 A) If the GC is growing after each build, it definitively means that there is some memory leak persisting after each build, constraining the memory more and more. You can profile the GradleDaemon and the KotlinCompileDaemon to check their memory usage build after build, and potentially do a memory dump to figure out what is causing this. Until you figure that out, you must probably should increase the max memory for the daemon having this. B) The workers with different jdk mean that you are specifying to use that jdk for the task they are executing. C) AFAIK the compileKotlin should happen just inside the KotlinCompileDaemon. Are these workers spawn for the compile or you are also running some tests or other tasks as part of your build that are producing them? The fact that they have 512mb suggest me that they are test workers indeed (as this is the default memory settings for the test task). Also this might explain why they are using jdk11, as you might have your test suite requiring that jdk11? D) Each of these workers appear and remains after each build? I believed that workers were always ephemeral and should be destroyed after they finish their execution, so this is odd as well, but I might be missing something.
d
yes this will destroyed after build finish. It seems related to gradle 8, or tool chain 11. i tried to revert those changes and it will not spawn any workers. will check it first, appreciate your help
it seems gradle workers will be spawn when im using source and target Java 11, and then compiling using JDK 17, is it something expected ?
Copy code
compileOptions {
    coreLibraryDesugaringEnabled true
    sourceCompatibility JavaVersion.VERSION_11
    targetCompatibility JavaVersion.VERSION_11
}

dependencies {
    coreLibraryDesugaring libraries.desugaring
}

pluginManager.withPlugin("kotlin-android") {
    kotlin{
        jvmToolchain(11)
    }

}
t
Gradle worker for which type of work? 🤔