How much RAM does a Minecraft server need?
Most Paper servers do well with 3 to 8 GB of heap: 3 or 4 GB for a group of friends, 5 or 6 GB for 20 or 30 players with a normal set of plugins, and 8 GB or more past 50 players. The plan you rent has to be a bit bigger than that, because Java also uses memory outside the heap.
| Players online | Plugins | Minimum | Recommended | Plan or container |
|---|---|---|---|---|
| 5 | 10 | 2 GB | 3 GB | 4 GB |
| 10 | 15 | 3 GB | 4 GB | 5 GB |
| 20 | 25 | 3 GB | 5 GB | 6 GB |
| 30 | 40 | 4 GB | 6 GB | 7 GB |
| 50 | 50 | 5 GB | 8 GB | 10 GB |
| 100 | 80 | 8 GB | 13 GB | 15 GB |
The calculator above does the same sum with your numbers. Take the result as a starting point: real use depends on how spread out the players are, the view distance and what each plugin does.
How the estimate is worked out
The calculator adds up the heap, the memory Java gives Minecraft (the one you set with -Xmx):
- 2 GB base for Paper or Purpur with its worlds loaded and nobody online. Folia starts at 3 GB, because it’s made for many players spread across the map.
- 75 MB per player online at once. Each player keeps the chunks around them loaded, with the mobs and items in them. Players spread across the world cost more than players standing together in a lobby.
- 40 MB per plugin, on average. Most plugins use far less, and a few use far more.
- 2 GB more for heavy plugins or a big world: web maps (Dynmap, BlueMap), custom models (ItemsAdder, ModelEngine), lots of mobs or farms, or a view distance over 10.
- Three quarters of the total on 1.8 to 1.11, whose chunks are lighter.
The result is rounded up to whole GB and never goes below 3 GB (2 GB on 1.8 to 1.11). The minimum is about two thirds of it: the server runs, with little room for busy moments, new chunks being generated or backups. The calculator stops at 31 GB, because above about 32 GB Java turns off compressed object pointers, and going a little past that leaves less usable memory, not more.
These numbers lean high on purpose. Running short of memory makes a server stutter and then crash, while a little too much only costs a bit more each month.
Leave room for Java: heap and plan
-Xmx only limits the heap. Java also uses memory for the classes of every plugin, its threads, the code it compiles, network buffers and the garbage collector’s own bookkeeping. The calculator keeps 1 GB or 15 % of the heap for that, whichever is more, in line with Paper’s advice to give -Xmx 1000 to 1500 MB less than the memory you have. In practice:
- Renting a plan: go by the plan size the calculator shows, not the heap. An 8 GB heap needs a 10 GB plan.
- Already have a plan: enter it in Your plan’s RAM and the flags are sized to fit inside it. An 8 GB plan leaves a 6.5 GB heap.
- Pterodactyl, Docker and most hosts limit the whole container. If Java goes over, the server is killed on the spot, often with no error in the console.
- Your own PC or VPS: leave memory for the operating system and anything else running there.
Why -Xms equals -Xmx
Aikar’s flags give -Xms and -Xmx the same value and add -XX:+AlwaysPreTouch, which reserves the whole heap when the server starts. G1 works better with a heap that never grows or shrinks, and if the memory isn’t really there, you find out at boot. One side effect: your panel’s memory graph shows the whole heap in use from the first minute. That’s expected.
Aikar’s flags and ZGC
Aikar’s flags tune the G1 garbage collector to the way Minecraft uses memory: huge numbers of objects that live for one tick, and pauses that have to stay short. Paper recommends them, and they suit servers of any size. Over 12 GB of heap the calculator switches to Aikar’s values for big heaps: G1NewSizePercent=40, G1MaxNewSizePercent=50, G1HeapRegionSize=16M, G1ReservePercent=15 and InitiatingHeapOccupancyPercent=20.
ZGC is a different collector that does nearly all its work while the server keeps running, so pauses stay under a millisecond. In exchange it uses more CPU, and it only makes sense on large heaps (16 GB or more) with spare cores. Use the generational version: on Java 21 it needs -XX:+ZGenerational, and from Java 23 it’s the default, so the calculator leaves that flag out. If you’re not sure, stay with G1.
Which Java version
| Minecraft | Java |
|---|---|
| 26.1 and newer | 25 |
| 1.20 – 1.21.11 | 21 |
| 1.17 – 1.19.4 | 17 |
| 1.16.5 | 16 |
| 1.12 – 1.16.4 | 11 |
| 1.8 – 1.11 | 8 |
This is the table in Paper’s documentation. Check which one you have with java -version. If several are installed, the script starts whichever one the java command runs.
Starting the server
- Fill in players, plugins, software and version, plus your plan’s RAM if you already have one.
- Pick a Start script:
- start.sh for Linux and macOS. Save it next to the jar, run
chmod +x start.shonce, then./start.sh. - start.bat for Windows. Save it next to the jar and double-click it. The
pauseat the end keeps the window open if the server stops, so you can read the error. - Pterodactyl gives the startup command, with
{{SERVER_JARFILE}}so the panel fills in the jar. Then set the server’s memory in the panel to at least the plan size. - Flags only is for hosts with a field for JVM arguments. If your host sets the memory itself, remove
-Xmsand-Xmx.
- start.sh for Linux and macOS. Save it next to the jar, run
- Press Copy. Copy share link keeps your settings in the link.
When more RAM won’t help
Lag usually comes from the CPU: a normal server does most of its work on one main thread, so a faster core helps more than extra memory. Before upgrading, run /spark health to see memory and TPS, and /spark profiler to see what takes the time. spark comes with Paper since 1.21. Lowering view-distance and simulation-distance saves memory and CPU at once, and pre-generating the world with a plugin such as Chunky avoids the spikes of generating new chunks while people play.