Tools / Minecraft
Minecraft server RAM calculator
Enter your player count, server software, view distance and world age. You get a plan size in GB, the reason for each part of it, and a startup line with Aikar's flags and a heap that leaves the container room to breathe.
Calculator
Your server
Recommended
4 GB
Plan RAM
3200M
Heap, for -Xms and -Xmx
2.5 GB
Heap this server needs
A 4 GB plan with a 3200M heap leaves 896 MB for the memory Java uses outside the heap.
- Server type
- 2 GB
- A Paper or Spigot server with a normal plugin set holds about 2 GB before anyone joins.
- Players
- +0.5 GB
- 10 players at about 50 MB each. Players cost memory through the chunks they keep loaded, not the connection.
- View distance
- 289 chunks
- View distance 8 keeps 289 chunks loaded per player. This is the baseline the per-player figure assumes.
- World
- +0 GB
- A new world has little built in it yet. Generating fresh terrain costs CPU time, not heap.
Startup line
JVM startup line with Aikar's flags
java -Xms3200M -Xmx3200M -XX:+UseG1GC -XX:+ParallelRefProcEnabled -XX:MaxGCPauseMillis=200 -XX:+UnlockExperimentalVMOptions -XX:+DisableExplicitGC -XX:+AlwaysPreTouch -XX:G1NewSizePercent=30 -XX:G1MaxNewSizePercent=40 -XX:G1HeapRegionSize=8M -XX:G1ReservePercent=20 -XX:G1HeapWastePercent=5 -XX:G1MixedGCCountTarget=4 -XX:InitiatingHeapOccupancyPercent=15 -XX:G1MixedGCLiveThresholdPercent=90 -XX:G1RSetUpdatingPauseTimePercent=5 -XX:SurvivorRatio=32 -XX:+PerfDisableSharedMem -XX:MaxTenuringThreshold=1 -Dusing.aikars.flags=https://mcflags.emc.gs -Daikars.new.flags=true -jar paper.jar --nogui
One line. Change the jar name to match your file.
Worked out in your browser. Nothing you enter here is sent or stored.
Method
How the number is worked out
The calculator starts from a base heap for the server software, because the game, its plugins or its mods occupy memory before anyone joins. It then adds an allowance per player. Players cost memory through the chunks they keep loaded, so that allowance scales with view distance: one player holds (2 x distance + 1) squared chunks, which is 289 at view distance 8 and 441 at 10.
The base and per-player figures follow the heap sizes in our guide, How Much RAM Does a Minecraft Server Need?, which assume view distance 8. They are rules of thumb, not measurements of your server. An established world adds a small allowance for the block entities, farms and chunk loaders it accumulates. Size on disk adds nothing, because only loaded chunks occupy memory.
That sum is a heap, the value passed to -Xmx. Java also needs memory outside the heap, so the plan has to be larger. The calculator picks the smallest plan that leaves 20% of the container free, and never less than 512 MB, then sets -Xms to the same value so the heap never resizes while the server runs.
The startup line uses Aikar's flags as published in the Paper documentation. For a heap above 12 GB it switches five G1 values to the ones Aikar's own write-up gives for large heaps: a 40 to 50% new generation, 16M regions, a 15% reserve and an initiating occupancy of 20%.
Worked examples at view distance 8
| Server | Heap needed | Plan | -Xmx |
|---|---|---|---|
| Vanilla, 5 players | 1.5 GB | 2 GB | 1500M |
| Paper with plugins, 10 players | 2.5 GB | 4 GB | 3200M |
| Paper with plugins, 20 players, established world | 3.3 GB | 6 GB | 4900M |
| Paper with plugins, 40 players | 4.0 GB | 6 GB | 4900M |
| Light modpack, 6 players | 3.2 GB | 4 GB | 3200M |
| Heavy modpack, 8 players | 5.6 GB | 8 GB | 6500M |
| Kitchen-sink modpack, 10 players | 9.0 GB | 12 GB | 9800M |
Server types used: Vanilla, Paper or Spigot with plugins, Light modpack (40 to 80 mods), Heavy modpack (150 to 250 mods), Kitchen-sink modpack (300+ mods). Treat every row as a starting point, then measure the live server with spark.
FAQ
Minecraft RAM calculator: questions
Why is -Xmx lower than the plan size?
Java uses memory outside the heap for loaded classes, thread stacks, the JIT code cache and network buffers. If -Xmx equals the container limit, that extra memory pushes the container over and the kernel kills the server with exit code 137 and no Java error. The calculator sets the heap about 20% below the plan, with at least 512 MB left free.
Will more RAM fix a laggy Minecraft server?
Only if the heap is the problem. Tick time is single-threaded CPU work, so a server with high MSPT and a healthy heap gains nothing from more memory. More RAM is the right fix when the log shows OutOfMemoryError, or when heap in use stays above about 85% of -Xmx straight after a full garbage collection.
Do Aikar's flags work with Forge, NeoForge and Fabric?
Yes. They tune the G1 garbage collector in the JVM, so they apply to any Minecraft server jar. Fabric and Paper take them on the java command line. Current Forge and NeoForge servers read JVM flags from the user_jvm_args.txt file next to run.sh, one flag per line.
Should -Xms and -Xmx be the same?
Yes, on a server. A fixed heap never pauses to grow or shrink, and G1 sizes its regions once at startup. Aikar's flags assume both values match, which is why the startup line sets them to the same number.
Is anything I enter sent to Puranode?
No. The calculation runs in your browser. The page makes no request with your inputs and stores nothing.
Need somewhere to run it?
Puranode hosts Minecraft servers on EPYC and NVMe in the EU: Paper, Spigot, Forge and Fabric.