mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
a temporary fix for AppScheduledExecutorServiceTest
GitOrigin-RevId: 792eabdb58aaa9ed87f2095943a40d129937ace2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
793c2a6862
commit
e0cd053939
@@ -16,9 +16,7 @@ import java.lang.management.ManagementFactory;
|
||||
import java.lang.management.MemoryNotificationInfo;
|
||||
import java.lang.management.MemoryPoolMXBean;
|
||||
import java.lang.management.MemoryType;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.*;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
public class LowMemoryWatcherManager implements Disposable {
|
||||
@@ -28,7 +26,7 @@ public class LowMemoryWatcherManager implements Disposable {
|
||||
@NotNull private final ExecutorService myExecutorService;
|
||||
|
||||
private Future<?> mySubmitted; // guarded by ourJanitor
|
||||
private final Future<?> myMemoryPoolMXBeansFuture; // guarded by ourJanitor
|
||||
private final Future<?> myMemoryPoolMXBeansFuture;
|
||||
private final AtomicBoolean myProcessing = new AtomicBoolean();
|
||||
private final Consumer<Boolean> myJanitor = new Consumer<Boolean>() {
|
||||
@Override
|
||||
@@ -45,7 +43,7 @@ public class LowMemoryWatcherManager implements Disposable {
|
||||
public LowMemoryWatcherManager(@NotNull Executor executorService) {
|
||||
myExecutorService = SequentialTaskExecutor.createSequentialApplicationPoolExecutor("LowMemoryWatcherManager", executorService);
|
||||
|
||||
myMemoryPoolMXBeansFuture = myExecutorService.submit(() -> {
|
||||
myMemoryPoolMXBeansFuture = Executors.newSingleThreadExecutor().submit(() -> {
|
||||
try {
|
||||
for (MemoryPoolMXBean bean : ManagementFactory.getMemoryPoolMXBeans()) {
|
||||
if (bean.getType() == MemoryType.HEAP && bean.isCollectionUsageThresholdSupported() && bean.isUsageThresholdSupported()) {
|
||||
|
||||
Reference in New Issue
Block a user