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

  1. Read your actual startup script or panel arguments and identify -Xms and -Xmx (case-sensitive).
  2. Compare Xmx with hosting memory capacity and leave room for the OS, threads, metaspace and native allocations.
  3. 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.
  1. For example a machine with enough RAM might use -Xms4G -Xmx4G on a modern Paper server, but this is not a universal recommendation.
  2. If you choose a lower Xms for startup flexibility, test its heap growth/GC behavior rather than claiming it is always slower.
  3. 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.

Related topic: JVM Flags for Minecraft Servers: What Actually Matters. Compare the two guides when choosing the right diagnostic or configuration step.

References