Your setup
Startup settingsG1GC
Start with G1GC. This ZGC preset targets Java 21. Select the Java version in your launcher or on your server.
For example, paper.jar. Use letters, numbers, dots, hyphens and underscores.
Start with this allocation
Allocate to the Minecraft process
- Minecraft
- 4 GB
- Headroom outside the game heap
- 1 GB
For hosting or a VPS, start around 5 GB including headroom.
This is an estimate from your settings, not a measurement of your game. Check it with your own pack.
start.shView code
#!/usr/bin/env bash java -Xms4G -Xmx4G -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
Where to use it
Save the script in the same folder as server.jar. Run bash start.sh. Check your Java version first with java -version.
server.propertiesOptional
Example view-distance settings. Back up the file and replace only the lines you need. More RAM does not replace CPU performance.
view-distance=8 simulation-distance=6 max-players=10 network-compression-threshold=256