# HG changeset patch # User Luke Hoersten # Date 1593636478 18000 # Node ID f00f45a9512dd492eae2f8f0cc1d6d5a7a3c425c # Parent 9057b9f9ced8255ae0c6424f50c90a878e9aecb4 Optimized jvm flags for paper. diff -r 9057b9f9ced8 -r f00f45a9512d papermc/templates/papermc.service.j2 --- a/papermc/templates/papermc.service.j2 Wed Jul 01 14:51:38 2020 -0500 +++ b/papermc/templates/papermc.service.j2 Wed Jul 01 15:47:58 2020 -0500 @@ -11,7 +11,9 @@ WorkingDirectory={{papermc_dir}} Restart=on-failure RestartSec=20 5 -ExecStart=/usr/bin/java -Xms{{papermc_mem}} -Xmx{{papermc_mem}} -jar server.jar +# ExecStart=/usr/bin/java -Xms{{papermc_mem}} -Xmx{{papermc_mem}} -jar server.jar +# Optimizations from https://aikar.co/2018/07/02/tuning-the-jvm-g1gc-garbage-collector-flags-for-minecraft/ +ExecStart=/usr/bin/java -Xms{{papermc_mem}} -Xmx{{papermc_mem}} -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar server.jar nogui PrivateTmp=true ProtectSystem=full