Sizing · 5 min read
How much RAM does a Minecraft server need?
RAM for a Minecraft server by player count and modpack size, how to set it with -Xmx, the settings that cut it, and how to tell a memory problem from lag.
Last checked
Short answer
Vanilla and Paper
These are our estimates Est: Our estimate, from published requirements and community reports for a vanilla or Paper server at the default view distance of 10 chunks, with a few light plugins at most.
| Players | RAM | Our shortest pass | Our month pass |
|---|---|---|---|
| 2 | 2 GB | £2.00 a week | £5.44 |
| 5 | 2 GB | £2.00 a week | £5.44 |
| 10 | 3 GB | £2.00 a day | £8.16 |
| 20 | 4 GB | £2.00 a day | £9.79renewing, £10.88paid once |
| 40 | 6 GB | £2.00 a day | £14.68renewing, £16.32paid once |
Renewing or paid once. Bought with renewal, a week or month pass of 4 GB or more costs 10% less than the same pass paid once, on the first payment and every renewal, while renewal stays on. Stopping renewal is free and takes nothing back: the pass you've paid for runs to its end at the price you paid. Any pass paid for once is at the pay-once price.
Mojang's own start command gives the server 4 GB, more than a small group needs. The Minecraft Wiki says 2 GB is plenty for a home server with five players.
Modpacks
For modded servers the pack matters more than the players. Every mod adds code, recipes and often world generation, so a 300-mod kitchen-sink pack needs well over twice what a light 50-mod pack does.
| Mods (4 players) | RAM | Our shortest pass | Our month pass |
|---|---|---|---|
| 50 | 6 GB | £2.00 a day | £14.68renewing, £16.32paid once |
| 150 | 8 GB | £2.00 a day | £19.58renewing, £21.76paid once |
| 300 | 10 GB | £2.70 a day | £24.48renewing, £27.20paid once |
| 450 | 16 GB | £4.32 a day | £39.16renewing, £43.52paid once |
If the pack author publishes a recommended server size, start there: authors test their own packs.
What uses the memory
A Java Edition server is a Java program with a fixed memory budget, the heap. Three things fill it: the world chunks loaded around each player, the entities in those chunks (mobs, items, minecarts, villagers), and the code of any plugins or mods. Players matter mostly because each one loads their own patch of world, so five players spread out cost more than five in one base.
More isn't always better. Memory the server never fills does nothing for it, and on your own PC it is memory the game and everything else can't use. Size for what you use, with some headroom.
How to give the server more RAM
On your own PC, the memory is set by two flags in the command that starts the server:
java -Xms4G -Xmx4G -jar server.jar nogui-Xmxis the most memory the server may use. This is the number that matters.-Xmsis what it starts with. Mojang's command sets both to the same figure.- Use
Gfor gigabytes orMfor megabytes:-Xmx3Gand-Xmx3072Mmean the same. - Java uses some memory outside that figure for itself, so never give the server all of the PC's memory. Leave room for the system and, if you play on the same PC, for the game.
On our servers you pick a size instead of typing flags: Java is told to use up to 85% of the server's memory, and the rest is left for Java itself.
Settings that change the answer
view-distanceis the biggest lever. It sets how many chunks the server keeps around every player, and the count grows with the square of the distance: dropping from 10 to 8 cuts it by about a third.simulation-distancecontrols how far away mobs and crops keep updating. Keeping it at or below the view distance saves CPU more than memory.- Mob farms and item piles fill memory and ticks alike. A farm that keeps hundreds of mobs loaded costs more than several extra players.
- Pre-generating a modded world before players arrive avoids the spikes from generating new chunks while people explore.
Both distances live in server.properties. Our server.properties generator explains each one and warns about values that cost a lot, and server.properties explained covers the rest of the file.
How to see what the server is using
- On Paper, the spark profiler comes built in (Paper's docs say so from 1.21). Type
spark health --memoryin the console for memory, CPU and ticks per second. - On your own PC, Task Manager or Activity Monitor shows the Java process.
- On our servers, the panel graphs CPU and memory side by side.
Java tends to keep memory it has taken, so a graph near the top is not on its own a sign of trouble. The signs are below.
Signs you need more, and signs you don't
| You see | What it means | What to do |
|---|---|---|
java.lang.OutOfMemoryError: Java heap space | What it meansThe server ran out of memory | What to doMore RAM, a lower view-distance, or fewer mods |
Can't keep up! Is the server overloaded? Running ...ms or ... ticks behind | What it meansTicks are taking too long. Usually CPU, entities or a busy farm, not memory | What to doLower simulation-distance, clear mob piles, check which chunk is busy |
A single server tick took ... seconds | What it meansOne tick froze for a minute and the watchdog stopped the server | What to doOften a stuck mod or a huge build. Read the crash report in the crash-reports folder |
| Rubber-banding and slow block breaking, no errors | What it meansLag between player and server | What to doCheck CPU first; more RAM rarely helps here |
Bedrock
Bedrock Dedicated Server is native code, not Java, and uses much less memory. The FAQ on Mojang's download page says at least 1 GB of RAM for small servers. Most groups fit comfortably in 2 GB.
Want numbers for your exact group? The RAM calculator uses the same estimates as this page. Setting a server up at home? See how to host a Minecraft server.