Partial revert of 80e35ef4f01b87c9d60123398754e2ea2a71b1c4

As the original commit significantly affects Kotlin performance benchmarks

GitOrigin-RevId: 38a6b927492c80054b8866c0b290e9b8d06ea8db
This commit is contained in:
Vladimir Dolzhenko
2025-05-10 19:10:48 +02:00
committed by intellij-monorepo-bot
parent 95ce697c69
commit 07d0bc84ab
2 changed files with 2 additions and 13 deletions

View File

@@ -72,6 +72,5 @@
<orderEntry type="module" module-name="intellij.tools.ide.starter.bus" />
<orderEntry type="module" module-name="intellij.platform.eel.provider" />
<orderEntry type="module" module-name="intellij.platform.recentFiles.frontend" />
<orderEntry type="library" name="jbr-api" level="project" />
</component>
</module>

View File

@@ -1,11 +1,9 @@
// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.jetbrains.performancePlugin.commands
import com.intellij.openapi.diagnostic.logger
import com.intellij.openapi.ui.playback.PlaybackContext
import com.intellij.openapi.ui.playback.commands.AbstractCommand
import com.intellij.openapi.util.ActionCallback
import com.jetbrains.JBR
import com.jetbrains.performancePlugin.utils.ActionCallbackProfilerStopper
import org.jetbrains.concurrency.Promise
import org.jetbrains.concurrency.toPromise
@@ -23,13 +21,7 @@ internal class GCCommand(text: String, line: Int) : AbstractCommand(text, line)
val ref = WeakReference(IntArray(32 * 1024))
try {
Waiter.checkCondition {
if (JBR.isSystemUtilsSupported()) {
JBR.getSystemUtils().fullGC()
}
else {
LOG.warn("The JBR.getSystemUtils API isn't supported. Using regular GC, but this might increase the probability of false positives")
System.gc()
}
System.gc()
(ref.get() == null).also { done ->
if (done) {
actionCallback.setDone()
@@ -42,6 +34,4 @@ internal class GCCommand(text: String, line: Int) : AbstractCommand(text, line)
}
return actionCallback.toPromise()
}
}
private val LOG = logger<GCCommand>()
}