Total RAM = Base(Loader/Pack) + Players × Rate + ChunkDelta(VD, SD) + GC Headroom (8%) + OS/Off-Heap Reserve (1–1.5 GB Panel or 15% VPS) | ≥12 GB on Java 21 → Generational ZGC
1. How Minecraft Server RAM Sizing Works (Modpacks & SMP)
Guessing how much RAM a Minecraft server needs leads to two opposite disasters: under-allocating triggers instant java.lang.OutOfMemoryError or Docker Exit Code 137 kills during chunk generation, while over-allocating on G1GC creates 300–800 ms stop-the-world lag spikes that freeze every player.
Safe -Xmx = Recommended Plan − OS/Off-Heap Reserve (1–1.5 GB on Panels, 15% on VPS)Loaded Chunks per Player = (2 × View Distance + 1)² (VD 10 = 441 chunks; VD 16 = 1,089 chunks)GC Threshold: Heap < 12 GB → Aikar's G1GC | Heap ≥ 12 GB + Java 21 → Generational ZGC
2. RAM Requirements for Popular Modpacks (2026 Benchmarks)
Modpacks scale differently depending on loader overhead (NeoForge / Forge vs Fabric), worldgen complexity, and Java runtime version:
| Modpack / Engine | Loader & Java | 2–4 Players | 5–10 Players | Recommended GC |
|---|---|---|---|---|
| All the Mods 10 (ATM10) | NeoForge · Java 21 | 10–12 GB | 16 GB | Generational ZGC |
| RLCraft (v2.9.3) | Forge 1.12.2 · Java 8 | 6–8 GB | 10 GB | Java 8 Legacy G1GC |
| Cobblemon Official | Fabric · Java 21 | 6 GB | 8–10 GB | Aikar's G1GC |
| Better MC 4 (BMC4) | Forge · Java 17 | 6–8 GB | 10–12 GB | Aikar's G1GC |
| Paper / Purpur SMP | Paper · Java 21 | 3–4 GB | 6–8 GB | Aikar's G1GC |
3. Aikar's G1GC vs. Java 21 Generational ZGC
- Aikar's G1GC Flags (4–12 GB): The gold standard for Paper, Purpur, Fabric, and Forge servers up to 12 GB heap. At
≥ 12 GB, Aikar's specification switchesG1NewSizePercentto40%andG1HeapRegionSizeto16M. - Java 21 Generational ZGC (12–24 GB+): Built for massive NeoForge/Fabric modpacks like ATM10. Unlike G1GC, ZGC performs garbage collection concurrently with sub-millisecond pauses (
< 1 ms) even on 16–24 GB heaps. - Why You Never Set
-XmxEqual to Container RAM: Java uses off-heap memory for Netty packets, JVM Metaspace, and native libraries. On Pterodactyl/Docker panels, setting-Xmx8Ginside an 8 GB container causes the host OOM Killer to terminate the server with Exit Code 137. Always leave1–1.5 GBof container headroom.
For a full deep dive into TPS profiling, Spark timings, and choosing between Paper, Purpur, and Fabric, read our Minecraft SMP Server RAM & Engine Guide, and use the Chunk & Region (.mca) Calculator to locate region files before running Chunky pre-generation.
Frequently Asked Questions
Should -Xms and -Xmx always be set to the same value?
Yes. Matching -Xms and -Xmx pre-allocates the full Java heap at boot (especially with -XX:+AlwaysPreTouch), eliminating mid-game lag spikes caused by the JVM resizing memory on the fly.
Why does my 8 GB hosted server crash with Exit Code 137 when -Xmx is 8G?
Minecraft's JVM consumes 1–1.5 GB of off-heap memory (Metaspace, Netty buffers, native threads) outside -Xmx. Inside an 8 GB Docker/Pterodactyl container, set -Xmx to 6.5G or 7G so the host OOM Killer doesn't terminate the process.
When should I use Java 21 Generational ZGC instead of Aikar's G1GC?
Switch to Generational ZGC (-XX:+UseZGC -XX:+ZGenerational) when running Java 21+ with a heap of 12 GB or higher—especially on heavy NeoForge/Fabric modpacks like ATM10—where G1GC pauses start exceeding 150–200 ms.
Can I use Aikar's or ZGC flags on RLCraft (Minecraft 1.12.2)?
No to ZGC—Minecraft 1.12.2 strictly requires Java 8, which does not support Generational ZGC. Use our Java 8 Legacy G1GC preset and keep the heap between 6 GB and 10 GB.