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.