IDEA-220088 Should be called at least at the phase COMPONENT_REGISTERED, the current phase is: SPLASH

GitOrigin-RevId: a21377dcf4b943ef19765241750aaa16e37ecc6d
This commit is contained in:
Vladimir Krivosheev
2019-08-07 16:05:50 +03:00
committed by intellij-monorepo-bot
parent cbce49e7f7
commit 934e4e62fd
2 changed files with 3 additions and 6 deletions
@@ -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
@@ -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;
}