🆕 7 FREE tools: Java→Bedrock converter, pack updater, image rank tags & more — plus 18 guides →
Home/Guides/Java Flags
⚡ Advanced · 10 min read

Java runtime flags, explained

Every line of the Aikar set, translated into English — so you know what to keep, what to delete and what never to touch.

By Unique TeamUpdated November 2026JVM · G1GC · ZGC

1. Heap flags

-Xms/-Xmx set the starting and maximum heap. Above 4 GB keep them equal: resizing the heap mid-session causes long pauses.

2. Inside G1GC

G1GC core: UseG1GC picks the region-based collector. MaxGCPauseMillis=200 tells G1 your stutter budget. G1NewSizePercent/G1MaxNewSizePercent reserve room for short-lived objects — exactly what entities and packets are.

3. Pre-touch & explicit GC

AlwaysPreTouch commits all pages at startup instead of lazily — a one-time cost that removes later page-fault stutters. DisableExplicitGC stops plugins calling System.gc() and nuking your frame times.

4. ZGC vs G1

ZGC/Shenandoah? Sub-millisecond pauses sound tempting, but Minecraft tick work is single-threaded; GC pause was rarely the bottleneck once allocation pressure is high. G1 with the Aikar set still wins on predictability for most servers. Try ZGC only if Spark shows GC threads dominating.

5. What to avoid

Never mix: old CMS flags, hand-tuned thread counts copied from 2015 forums, or two conflicting -XX:+Use* collectors. One collector, the tested set, done.

Quick answers

Do these flags work on Java 21?

Yes — the Aikar set targets modern JDKs. Some flags are ignored (with a warning) on very old Java 8 servers.

Flags without typos

The generator writes the whole flag set correctly with your RAM values and downloads start.bat / start.sh / Dockerfile.

Open start.bat generator