From 934e4e62fd653bf4387e46aa7d97009e57340f56 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Wed, 7 Aug 2019 14:56:34 +0200 Subject: [PATCH] IDEA-220088 Should be called at least at the phase COMPONENT_REGISTERED, the current phase is: SPLASH GitOrigin-RevId: a21377dcf4b943ef19765241750aaa16e37ecc6d --- platform/util/resources/misc/registry.properties | 3 --- .../com/intellij/openapi/util/LowMemoryWatcherManager.java | 6 +++--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties index 85e7654532d4..fac9df725aab 100644 --- a/platform/util/resources/misc/registry.properties +++ b/platform/util/resources/misc/registry.properties @@ -1404,9 +1404,6 @@ javafx.fxml.controller.from.loader.description=Resolve FXML controllers specifie inplace.change.signature=false inplace.change.signature.description=Enables change signature without dialog, inplace in the editor -low.memory.watcher.sync=true -low.memory.watcher.sync.description=Whether LowMemoryWatcher runnables should be executed on the same thread that the low memory events come - max.suggested.heap.size=2048 max.suggested.heap.size.description=The maximum Xmx value in megabytes that is going to be suggested by the EditXmxVMOption dialog diff --git a/platform/util/src/com/intellij/openapi/util/LowMemoryWatcherManager.java b/platform/util/src/com/intellij/openapi/util/LowMemoryWatcherManager.java index 853002a33b7c..8a33c7dc0885 100644 --- a/platform/util/src/com/intellij/openapi/util/LowMemoryWatcherManager.java +++ b/platform/util/src/com/intellij/openapi/util/LowMemoryWatcherManager.java @@ -3,7 +3,6 @@ package com.intellij.openapi.util; import com.intellij.openapi.Disposable; import com.intellij.openapi.diagnostic.Logger; -import com.intellij.openapi.util.registry.Registry; import com.intellij.util.Consumer; import com.intellij.util.SystemProperties; import com.intellij.util.concurrency.SequentialTaskExecutor; @@ -19,7 +18,7 @@ import java.lang.management.MemoryType; import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicBoolean; -public class LowMemoryWatcherManager implements Disposable { +public final class LowMemoryWatcherManager implements Disposable { private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.util.LowMemoryWatcherManager"); private static final long MEM_THRESHOLD = 5 /*MB*/ * 1024 * 1024; @@ -79,7 +78,8 @@ public class LowMemoryWatcherManager implements Disposable { if (memoryThreshold || memoryCollectionThreshold) { final boolean afterGc = memoryCollectionThreshold; - if (Registry.is("low.memory.watcher.sync", true)) { + // whether LowMemoryWatcher runnables should be executed on the same thread that the low memory events come + if (SystemProperties.getBooleanProperty("low.memory.watcher.sync", true)) { handleEventImmediately(afterGc); return; }