geforkt von Mirrors/Paper
Allow server startup for those poor people running <1G Xmx
Clamp logic for poolsize so we dont pass zero
Dieser Commit ist enthalten in:
Ursprung
ab609796e6
Commit
aba7b389ab
@ -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) {
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren