Minecraft Aikar's Flags & Startup Generator

Build copy-ready Aikar's G1GC or Java 21+ ZGC startup scripts to stop lag spikes.

PaperMC · G1GC & ZGC
Copper GPU heatsink fins, modular PSU cables, and server chassis with amber LEDs
Browser-Local Precision Engine Hardware & Servers · PaperMC · G1GC & ZGC
JVM Heap Allocation 8G / 8G Matching -Xms and -Xmx (recommended)
GC Profile Active Aikar Standard G1NewSize 30% / Region 8M
Paper Tuning Hint View 10 / Sim 5 Suggested distance defaults
Generated Startup Command & Script start.sh

How Minecraft Aikar Flags Works

PaperMC Heap & G1GC Region Scaling Rule

Heap_GB = Total_RAM - (1.5 GB if VPS else 0 GB)   # -Xms == -Xmx
Heap <= 12G -> G1NewSizePercent=30, G1MaxNewSizePercent=40, G1HeapRegionSize=8M
Heap >  12G -> G1NewSizePercent=40, G1MaxNewSizePercent=50, G1HeapRegionSize=16M

Minecraft servers allocate hundreds of megabytes of short-lived chunk and block objects every second. Default Java G1GC settings reserve only 5% of heap for newly created objects, causing rapid minor-collection pauses and sudden TPS drops whenever players load terrain or trigger redstone farms.

PaperMC's official Aikar's Flags expand the young-generation window to 30%-40% of heap (or 40%-50% with 16 MB regions when allocating more than 12 GB), disable explicit System.gc() calls from poorly written plugins, and pre-touch memory pages at boot so Linux does not stall mid-game. Always keep -Xms equal to -Xmx so the JVM never wastes CPU resizing heap dynamically.

When running on an unmanaged VPS or Docker host, reserve 1.5 GB outside Java's heap for operating system buffers and native JVM metaspace; on managed panels like Pterodactyl where container limits already wrap the process, you can pass the allocated tier directly. Running Java 21 or newer? You can also toggle Generational ZGC for sub-millisecond GC pauses on heavy servers.

Worked Example: Generating Flags for a 10 GB PaperMC VPS Server

  1. Start with 10 GB VPS RAM and deduct 1.5 GB OS headroom -> 8.5 GB (8704M) JVM heap.
  2. Because 8.5 GB is <= 12 GB, apply standard Aikar G1GC (G1NewSizePercent=30, G1HeapRegionSize=8M).
  3. Wrap with -Xms8704M -Xmx8704M, -jar paper.jar --nogui, and export as start.sh.

Result: Produces an instant start.sh command tuned to 8704M heap without OS OOM-killer risk.

Aikar's G1GC vs Generational ZGC Quick Reference

Profile Heap Size Key JVM Flags Best Use Case
Aikar Standard <= 12 GB G1NewSize=30%, Region=8M Paper / Purpur survival servers
Aikar Large Heap > 12 GB G1NewSize=40%, Region=16M Large networks & heavy modpacks
Generational ZGC 8 - 32 GB (Java 21+) -XX:+UseZGC -XX:+ZGenerational Sub-ms GC pauses with spare CPU

Formula & reference benchmark last verified: December 2026.

Frequently Asked Questions

Why should -Xms match -Xmx in Aikar's Flags?

Matching -Xms and -Xmx pre-allocates the full heap at startup, preventing runtime heap-resizing stalls and ensuring Aikar's percentage thresholds behave consistently.

When do the >12 GB Aikar flags activate?

PaperMC's guidelines scale G1NewSizePercent to 40%, G1MaxNewSizePercent to 50%, and G1HeapRegionSize to 16M once allocated heap exceeds 12 GB.

Should I use Aikar's G1GC or Java 21+ Generational ZGC?

Aikar's G1GC remains the proven default for Paper and Forge servers, while Generational ZGC (-XX:+UseZGC -XX:+ZGenerational) shines on Java 21+ rigs with 12+ GB RAM experiencing GC stutters.