diff --git a/compiler/daemon/daemon-common/src/org/jetbrains/kotlin/daemon/common/CompileService.kt b/compiler/daemon/daemon-common/src/org/jetbrains/kotlin/daemon/common/CompileService.kt index c77a2ecb9f4..13f8e7c3b8f 100644 --- a/compiler/daemon/daemon-common/src/org/jetbrains/kotlin/daemon/common/CompileService.kt +++ b/compiler/daemon/daemon-common/src/org/jetbrains/kotlin/daemon/common/CompileService.kt @@ -80,6 +80,7 @@ interface CompileService : Remote { @Throws(RemoteException::class) fun checkCompilerId(expectedCompilerId: CompilerId): Boolean + //Call with [withGC=true] can cause performance issue @Throws(RemoteException::class) fun getUsedMemory(withGC: Boolean = true): CallResult diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/compilerRunner/GradleKotlinCompilerWork.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/compilerRunner/GradleKotlinCompilerWork.kt index 90012186d4b..8faedbb6318 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/compilerRunner/GradleKotlinCompilerWork.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/compilerRunner/GradleKotlinCompilerWork.kt @@ -213,7 +213,7 @@ internal class GradleKotlinCompilerWork @Inject constructor( } } - val memoryUsageBeforeBuild = daemon.getUsedMemory(withGC = true).takeIf { it.isGood }?.get() + val memoryUsageBeforeBuild = daemon.getUsedMemory(withGC = false).takeIf { it.isGood }?.get() val targetPlatform = when (compilerClassName) { KotlinCompilerClass.JVM -> CompileService.TargetPlatform.JVM