Fixed high CPU usage on Java 8 (#3325)

Fixed https://bugs.openjdk.java.net/browse/JDK-8129861 by setting the core size of the TaskScheduler ThreadPool to 1
This commit is contained in:
RK_01 2023-05-23 18:18:10 +02:00 committed by GitHub
parent ed55bccfe4
commit 5c145d0184
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,7 @@ public final class TaskScheduler implements Scheduler {
private final ExecutorService executorService = Executors.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat("Via Async Task %d").build());
private final ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(
0,
1, // Fix for https://bugs.openjdk.java.net/browse/JDK-8129861
new ThreadFactoryBuilder().setNameFormat("Via Async Scheduler %d").build()
);