mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
Set cap on JDK per-thread native byte buffer cache
See: https://www.evanjones.ca/java-bytebuffer-leak.html This is potentially a source of lots of native memory usage. We are clearly seeing native usage upwards to 1-4GB which doesn't make sense. Region File usage fixed in previous patch should of tecnically only been somewhat temporary until GC finally gets it some time later, but between all the various plugins doing IO on various threads, this hidden detail of the JDK could be keeping long lived large direct buffers in cache. Set system properly at server startup if not set already to help protect from this.
This commit is contained in:
parent
269fd00d2a
commit
e058d38078
@ -27,6 +27,7 @@ public class Main {
|
||||
}
|
||||
// Paper end
|
||||
// Todo: Installation script
|
||||
if (System.getProperty("jdk.nio.maxCachedBufferSize") == null) System.setProperty("jdk.nio.maxCachedBufferSize", "262144"); // Paper - cap per-thread NIO cache size; https://www.evanjones.ca/java-bytebuffer-leak.html
|
||||
OptionParser parser = new OptionParser() {
|
||||
{
|
||||
this.acceptsAll(Main.asList("?", "help"), "Show the help");
|
||||
|
Loading…
Reference in New Issue
Block a user