From 8e51d142fedd14d224b8b0fd0b9416dfc00dadb1 Mon Sep 17 00:00:00 2001 From: Ivan Gomes Date: Fri, 7 Sep 2018 09:30:57 -0700 Subject: [PATCH] MDUMLCS-29045 Resolved high CPU usage at idle by mitigating JDK-8129861 bug. --- src/main/java/gov/nasa/jpl/mbee/mdk/util/TaskRunner.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/gov/nasa/jpl/mbee/mdk/util/TaskRunner.java b/src/main/java/gov/nasa/jpl/mbee/mdk/util/TaskRunner.java index 7ad6e9d81..8c67c80dd 100644 --- a/src/main/java/gov/nasa/jpl/mbee/mdk/util/TaskRunner.java +++ b/src/main/java/gov/nasa/jpl/mbee/mdk/util/TaskRunner.java @@ -20,7 +20,8 @@ import java.util.function.BiFunction; public class TaskRunner { - private static final ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(0); + // Cannot set corePoolSize to 0 due to bug that causes high CPU usage https://bugs.openjdk.java.net/browse/JDK-8129861 + private static final ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1); public static Future runWithProgressStatus(Runnable runnable, String title, ThreadExecutionStrategy strategy) { return runWithProgressStatus(runnable, title, strategy, false);