[Daemon] Change default Kotlin daemon JVM options

Now, the Kotlin daemon enables parallel GC and uses code cache flushing by default. Also, the default reserved code cache size is adjusted.

^KT-64283 Verification Pending
This commit is contained in:
Alexander.Likhachev
2023-12-21 17:29:07 +01:00
committed by Space Team
parent dbdcce0655
commit 58f7dd1c83
4 changed files with 76 additions and 3 deletions
@@ -470,11 +470,18 @@ object KotlinCompilerClient {
if (javaVersion != null && javaVersion >= 16)
listOf("--add-exports", "java.base/sun.nio.ch=ALL-UNNAMED")
else emptyList()
val jvmArguments = daemonJVMOptions.mappers.flatMap { it.toArgs("-") }
val additionalOptimizationOptions = listOfNotNull(
"-XX:+UseCodeCacheFlushing",
// enable parallel gc only if it's not explicitly disabled and no other GC is selected
"-XX:+UseParallelGC".takeIf { jvmArguments.none { it == "-XX:-UseParallelGC" || (it.startsWith("-XX:+Use") && it.endsWith("GC")) } },
)
val args = listOf(
javaExecutable.absolutePath, "-cp", compilerId.compilerClasspath.joinToString(File.pathSeparator)
) +
platformSpecificOptions +
daemonJVMOptions.mappers.flatMap { it.toArgs("-") } +
jvmArguments +
additionalOptimizationOptions +
javaIllegalAccessWorkaround +
COMPILER_DAEMON_CLASS_FQN +
daemonOptions.mappers.flatMap { it.toArgs(COMPILE_DAEMON_CMDLINE_OPTIONS_PREFIX) } +