Java Docker Images & JVM Arguments
Reference: https://github.com/Mukul1127/Minecraft-Performance-Flags-Benchmark
If you are on Java 1711+ (1.17+12+) we recommend the following arguments
-XX:+UseZGCUnlockExperimentalVMOptions -XX:AllocatePrefetchStyle=+UnlockDiagnosticVMOptions -XX:+AlwaysActAsServerClassMachine -XX:+AlwaysPreTouch -XX:+DisableExplicitGC -XX:NmethodSweepActivity=1 -XX:ReservedCodeCacheSize=400M -ZProactive
XX:NonNMethodCodeHeapSize=12M -XX:ProfiledCodeHeapSize=194M
If-XX:NonProfiledCodeHeapSize=194M you-XX:-DontCompileHugeMethods are-XX:MaxNodeLimit=240000 on-XX:NodeLimitFudgeFactor=8000 Java-XX:+UseVectorCmov 11/16-XX:+PerfDisableSharedMem (1.12-1.16)-XX:+UseFastUnorderedTimeStamps we recommend the following arguments
-XX:+UseG1GC -XX:MaxGCPauseMillis=130 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=28 -XX:G1HeapRegionSize=16M -XX:G1ReservePercent=20 -XX:G1MixedGCCountTarget=3 -XX:InitiatingHeapOccupancyPercent=10 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=0 -XX:SurvivorRatio=32 -XX:MaxTenuringThreshold=1 -XX:G1SATBBufferEnqueueingThresholdPercent=30 -XX:G1ConcMarkStepDurationMillis=5.0 -XX:G1ConcRefinementServiceIntervalMillis=150 -XX:G1ConcRSHotCardLimit=16 -XX:AllocatePrefetchStyle=3
If you are on Java 8 (<1.12) we recommend the following arguments
-XX:+UnlockExperimentalVMOptions -XX:+UnlockDiagnosticVMOptions -XX:+AlwaysActAsServerClassMachine -XX:+ParallelRefProcEnabled -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:+PerfDisableSharedMem -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -XX:MaxInlineLevel=15 -XX:MaxVectorSize=32 -XX:+UseCompressedOops -XX:ThreadPriorityPolicy=1 -XX:+UseDynamicNumberOfGCThreads -XX:NmethodSweepActivity=1 -XX:ReservedCodeCacheSize=350M -XX:-DontCompileHugeMethods -XX:MaxNodeLimit=240000 -XX:NodeLimitFudgeFactor=8000 -XX:+UseFPUForSpilling
Full default forced arguments (can't be modified)
java -Xmx{{SERVER_MEMORY}}M {{JVM_ARGS}} -Dterminal.jline=false -Dterminal.ansi=true -jar server.jar