Dont call GC for every task

This commit is contained in:
nataliya.valtman
2023-03-17 10:26:07 +01:00
committed by Space Team
parent a43a16b25b
commit 730502638a
2 changed files with 2 additions and 1 deletions
@@ -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<Long>
@@ -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