mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-05 02:10:30 +01:00
0f455f00ed
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.
23 lines
1.2 KiB
Diff
23 lines
1.2 KiB
Diff
From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 Mon Sep 17 00:00:00 2001
|
|
From: Aikar <aikar@aikar.co>
|
|
Date: Tue, 23 Oct 2018 23:14:38 -0400
|
|
Subject: [PATCH] Use more reasonable thread count default for bootstrap
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/DataConverterRegistry.java b/src/main/java/net/minecraft/server/DataConverterRegistry.java
|
|
index 7ac07ac07ac0..7ac07ac07ac0 100644
|
|
--- a/src/main/java/net/minecraft/server/DataConverterRegistry.java
|
|
+++ b/src/main/java/net/minecraft/server/DataConverterRegistry.java
|
|
@@ -22,7 +22,7 @@ public class DataConverterRegistry {
|
|
|
|
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, 2)))); // Paper - use more reasonable default - 2 is hard minimum to avoid using unlimited threads
|
|
DataFixer fixer = datafixerbuilder.build(pool);
|
|
pool.shutdown();
|
|
return fixer;
|
|
--
|
|
2.19.1
|
|
|