mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 22:09:38 +07:00
[core] IJPL-176043 Use JBR.getSystemUtils().fullGC() when clicking Memory Indicator
Unlike `System.gc()`, `JBR.getSystemUtils().fullGC()` makes an additional effort to collect softly reachable objects (by SoftReference) GitOrigin-RevId: 0b6f07fb18bcbe885169f4d2d02f63e12ebb3e6d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
add06f0759
commit
09cc77efe7
@@ -19,6 +19,7 @@ import com.intellij.util.ui.JBUI;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.util.ui.update.Activatable;
|
||||
import com.intellij.util.ui.update.UiNotifyConnector;
|
||||
import com.jetbrains.JBR;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -102,8 +103,12 @@ public final class MemoryUsagePanel implements CustomStatusBarWidget, Activatabl
|
||||
new ClickListener() {
|
||||
@Override
|
||||
public boolean onClick(@NotNull MouseEvent event, int clickCount) {
|
||||
//noinspection CallToSystemGC
|
||||
System.gc();
|
||||
if (JBR.isSystemUtilsSupported()) {
|
||||
JBR.getSystemUtils().fullGC();
|
||||
} else {
|
||||
//noinspection CallToSystemGC
|
||||
System.gc();
|
||||
}
|
||||
StorageLockContext.forceDirectMemoryCache();
|
||||
DirectByteBufferAllocator.ALLOCATOR.releaseCachedBuffers();
|
||||
PlatformMemoryUtil.getInstance().trimLinuxNativeHeap();
|
||||
|
||||
Reference in New Issue
Block a user