Direct answer
The choice should account for the machine/panel RAM budget and the collector. Paper documents equal Xms/Xmx in its G1GC guidance, while newer default-JVM setups can start with simpler flags.
How to check it
- Read your actual startup script or panel arguments and identify
-Xmsand-Xmx(case-sensitive). - Compare Xmx with hosting memory capacity and leave room for the OS, threads, metaspace and native allocations.
- Check GC pauses and process memory while under normal peak load before increasing the heap.
What to change
java -Xms4G -Xmx4G -jar paper.jar --nogui
# Choose values below your real RAM limit; example only.- For example a machine with enough RAM might use
-Xms4G -Xmx4Gon a modern Paper server, but this is not a universal recommendation. - If you choose a lower Xms for startup flexibility, test its heap growth/GC behavior rather than claiming it is always slower.
- Change memory flags only during restart; never copy a large heap allocation onto a small container.
Software and version notes
Compatibility and safety
PaperMC explains G1GC-specific equal-heap flag choices and also provides a modern JVM script generator with minimal flags. Java version and target Paper/Minecraft release must match.
Verify the result
Verify the JVM starts cleanly, heap flags are applied, GC pauses remain acceptable and the host has free memory at peak.