3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 16:40:10 +01:00

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
Dieser Commit ist enthalten in:
RK_01 2023-05-23 18:18:10 +02:00 committet von GitHub
Ursprung ed55bccfe4
Commit 5c145d0184
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -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 ExecutorService executorService = Executors.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat("Via Async Task %d").build());
private final ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool( 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() new ThreadFactoryBuilder().setNameFormat("Via Async Scheduler %d").build()
); );