Tweak ThreadPoolExecutor max pool size again

This commit is contained in:
Vankka 2023-07-16 12:05:15 +03:00
parent 85d40a061b
commit 5d87915eaa
No known key found for this signature in database
GPG Key ID: 6E50CB7A29B96AD0

View File

@ -42,8 +42,8 @@ public class StandardScheduler implements Scheduler {
new ThreadPoolExecutor(
/* Core pool size */
1,
/* Max pool size: cpu cores / 2 or at least 1 */
Math.max(1, Runtime.getRuntime().availableProcessors() / 2),
/* Max pool size: cpu cores - 2 or at least 4 */
Math.max(4, Runtime.getRuntime().availableProcessors() - 2),
/* Timeout */
60, TimeUnit.SECONDS,
new SynchronousQueue<>(),