mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 04:02:06 -07:00
Allow server startup for those poor people running <1G Xmx
Clamp logic for poolsize so we dont pass zero
This commit is contained in:
@@ -97,7 +97,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ // Paper start
|
||||
+ public static byte[] EMPTY_NIBBLE = new byte[2048];
|
||||
+ private static final int nibbleBucketSizeMultiplier = Integer.getInteger("Paper.nibbleBucketSize", 3072);
|
||||
+ private static final int maxPoolSize = Integer.getInteger("Paper.maxNibblePoolSize", (int) Math.min(6, Runtime.getRuntime().maxMemory() / 1024 / 1024 / 1024) * (nibbleBucketSizeMultiplier * 8));
|
||||
+ private static final int maxPoolSize = Integer.getInteger("Paper.maxNibblePoolSize", (int) Math.min(6, Math.max(1, Runtime.getRuntime().maxMemory() / 1024 / 1024 / 1024)) * (nibbleBucketSizeMultiplier * 8));
|
||||
+ public static final PooledObjects<byte[]> BYTE_2048 = new PooledObjects<>(() -> new byte[2048], maxPoolSize, 8);
|
||||
+ public static void releaseBytes(byte[] bytes) {
|
||||
+ if (bytes != null && bytes != EMPTY_NIBBLE && bytes.length == 2048) {
|
||||
|
Reference in New Issue
Block a user