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
- Start with 10 GB VPS RAM and deduct 1.5 GB OS headroom -> 8.5 GB (8704M) JVM heap.
- Because 8.5 GB is <= 12 GB, apply standard Aikar G1GC (G1NewSizePercent=30, G1HeapRegionSize=8M).
- 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.