From 0f455f00edd7d90cc42333129e7c175b117d2236 Mon Sep 17 00:00:00 2001 From: Aikar Date: Mon, 5 Nov 2018 17:25:08 -0500 Subject: [PATCH] Use at minimum 2 threads for Data fixers Per MC-138093 comments, ForkJoinPool uses unlimited threads if parallelism is ever 1. A 2 core machine will end up with 1 with the change I had previously made, so bumped the min to 2 so we will never trigger the unlimited thread situation. This aligns the min back with Spigot, but allows use of more threads on systems with more cores. --- ...0-Use-more-reasonable-thread-count-default-for-bootstr.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Spigot-Server-Patches/0400-Use-more-reasonable-thread-count-default-for-bootstr.patch b/Spigot-Server-Patches/0400-Use-more-reasonable-thread-count-default-for-bootstr.patch index 4fd2497203..f5ad5599c0 100644 --- a/Spigot-Server-Patches/0400-Use-more-reasonable-thread-count-default-for-bootstr.patch +++ b/Spigot-Server-Patches/0400-Use-more-reasonable-thread-count-default-for-bootstr.patch @@ -13,7 +13,7 @@ index 7ac07ac07ac0..7ac07ac07ac0 100644 a(datafixerbuilder); // CraftBukkit start - ForkJoinPool pool = new ForkJoinPool(Integer.getInteger("net.minecraft.server.DataConverterRegistry.bootstrapThreads", Math.min(Runtime.getRuntime().availableProcessors(), 2))); -+ ForkJoinPool pool = new ForkJoinPool(Integer.getInteger("net.minecraft.server.DataConverterRegistry.bootstrapThreads", Math.min(6, Math.max(Runtime.getRuntime().availableProcessors() - 2, 1)))); // Paper - use more reasonable default ++ ForkJoinPool pool = new ForkJoinPool(Integer.getInteger("net.minecraft.server.DataConverterRegistry.bootstrapThreads", Math.min(6, Math.max(Runtime.getRuntime().availableProcessors() - 2, 2)))); // Paper - use more reasonable default - 2 is hard minimum to avoid using unlimited threads DataFixer fixer = datafixerbuilder.build(pool); pool.shutdown(); return fixer;