How much RAM does a Minecraft server need? How to measure
Java often uses almost all the allocated RAM, but actual usage is closer to half. See how to measure, size, and tune Minecraft server memory.
· 5 min read

How much RAM does a Minecraft server need? How to measure
"Just add more RAM and it'll fix it." If you've ever asked for help in a Minecraft Discord, you've certainly heard this. The problem is that, in most cases, the server isn't out of memory — its memory is poorly distributed, its CPU is constrained, or a bunch of chunks are being generated at the same time.
The right question isn't "how much RAM do I buy?", but rather "what does my server do with the RAM it has?". This guide is about that: measuring, interpreting the numbers, and sizing the Java heap without guessing.
Why "more RAM" almost never solves lag
A recently published analysis by ZAP-Hosting, with data from 192 real Minecraft servers, shows a pattern that confuses many people: Java tends to use almost all the RAM you give it, but actual average usage stays close to half of what was purchased.
In other words: seeing the panel show 90% memory doesn't mean the server is drowning. Java (and the garbage collector) reserves space aggressively and gives that space back slowly. What matters is whether the server can maintain 20 ticks per second, not whether the graph is near the top.
There is only one symptom of genuinely insufficient RAM: the server gets slow and the log shows java.lang.OutOfMemoryError or the process dies on its own. Apart from that, more memory usually just makes the garbage collector less urgent — it doesn't make the world faster.
What actually consumes memory in your world
Before buying double the RAM, look at the usual four suspects:
- Loaded chunks. Each player keeps an area around them loaded: with
view-distance=10, that's 441 chunks per player; withview-distance=5, 121. On a server with 15 people spread across the map, that becomes thousands of chunks at the same time. - Entities. Farm mobs, items dropped on the ground, item frames, boats, and stationary minecarts. Giant iron or gold farms are great for resources and terrible for memory and CPU.
- Plugins and mods. Web map plugins, economy, land protection, and anti-cheat usually weigh more than the world itself.
- World generation. Exploring new territory is the most expensive task there is: it uses CPU, disk, and memory at the same time, and that's why it causes those "blocks coming back" freezes.
A fun fact that won't change your life: in the Minecraft 26.4 snapshots, Vulkan became the default graphics backend for Java Edition. This improves the client side, but doesn't reduce the server's RAM usage.
How to measure before changing anything
Diagnosis first, configuration later. On Paper, start with the basic commands:
/tps
/msptThe /tps shows ticks per second (ideally 20.0). The /mspt shows how many milliseconds each tick is taking — consistently above 50 ms, you're losing ticks.
Then move on to Spark, the community's most widely used diagnostic plugin. Once it's installed:
/spark tps
/spark health
/spark heap summary
/spark profiler startLet the profiler run for 5 to 10 minutes during lag (with players online, farms active, exploration happening). Then:
/spark profiler stopThe report will tell you whether the bottleneck is in the garbage collector, entities, chunk generation, or a specific plugin. Without that data, any adjustment is a guess.
Java heap is not the computer's RAM
This is the most common confusion. The machine has, for example, 8 GB. You shouldn't give all 8 GB to Java — the panel, the operating system, backups, and the process itself need room to breathe.
The heap limit is defined at startup:
java -Xms4G -Xmx4G -jar paper.jar nogui-Xmsis the initial memory and-Xmxis the ceiling. Setting both to the same value prevents the server from requesting memory from the system at every spike.- If you configure RAM through the hosting panel, the panel value is the
-Xmx. You don't need to (and in many cases can't) edit the command. - A server with 4 GB of heap usually runs on a machine with 5 to 6 GB, so there's some headroom.
- Avoid swap. When the server starts using disk as memory, every tick becomes an eternity.
About the famous Aikar flags (the G1GC argument block everyone copies): PaperMC's own documentation now recommends testing without flags first on modern JVMs (Java 21 and newer). They smooth out garbage collector pauses, but they don't work magic and can get in the way if the problem is something else.
Starting points by server type
There is no official players-per-GB table, but there is a common-sense reference for starting tests:
Scenario | Starting heap |
|---|---|
Vanilla or Paper, up to 5 friends, default view-distance | 2 GB |
Paper with 10 to 20 players and lightweight plugins | 4 GB |
Community server with farms, protection, and web map | 6 GB |
Modpack (Fabric/Forge) with 100+ mods | 6 to 8 GB or more |
After running for a week with real players, compare: if TPS stays at 20 and the heap never reaches the cap, you're using too much RAM — you can reduce it and save. If OutOfMemoryError appears, then increase it.
Signs that the problem is NOT RAM
- Low TPS with memory to spare: almost always CPU or entities.
- Freezes every few seconds: poorly tuned garbage collector or heap too small.
- Blocks reverting and mobs stuck: chunk generation in a new area.
- Lag only when someone opens the web map or runs a backup: disk I/O.
Swapping RAM for CPU doesn't help — and swapping CPU for RAM doesn't either. Each bottleneck has its remedy.
Step by step to adjust without breaking anything
- Install Spark and measure TPS/MSPT at an actual peak time.
- Record memory usage after at least 30 minutes of gameplay.
- Reduce
view-distanceandsimulation-distanceone step at a time and compare the numbers. - Limit entities per chunk and clear dropped items with routine cleanup plugins.
- Only then touch
-Xms/-Xmx, always in powers of 2 and with headroom for the system. - Write everything down. The tweak that worked with 8 players may not work with 20.
Conclusion
RAM is the easiest metric to look at and the easiest to misinterpret. Java will fill whatever space you give it, so use measured numbers — TPS, MSPT, Spark report — instead of the panel graph. In most cases, what the server lacks isn't memory: it's fewer loaded chunks, fewer loose entities, and an honest diagnosis.
If you want to run these tests without setting up infrastructure from scratch, Mine Hour lets you spin up a Paper server in under a minute and pause it when the last player leaves — which also helps when comparing performance with the world stopped.
Sources
More posts
How to import a world to the Minecraft serverStep by step to move the single-player world (or another host's) to the server: correct folders, level-name, 26.1 changes and common mistakes.
How to install plugins on a Minecraft server (Paper)Step-by-step guide to installing plugins on your Paper server: where to download them, how to check whether they loaded, which ones are worth getting first, and how to fix the most common errors.
How to configure a Minecraft server: administration guideserver.properties, whitelist, operators, gamerules, backups and version switching: the practical guide to administering your Minecraft server without breaking the world.
Building and survival games to play with friendsSeven building and survival games to play with friends: what each one does best, how many players they support, and how to keep the world online without depending on the host.