Skip to content
Sign inStart a server

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

2 GB for a vanilla or Paper server with up to about five players, 3 GB for ten and 4 GB for twenty. A modpack needs 6 to 16 GB, mostly depending on how many mods it has. Bedrock needs far less than Java. These are our estimates; the tables below break them down.

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.

Estimated RAM for a vanilla Minecraft Java server by players
PlayersRAMOur shortest passOur month pass
22 GB£2.00 a week£5.44
52 GB£2.00 a week£5.44
103 GB£2.00 a day£8.16
204 GB£2.00 a day£9.79renewing, £10.88paid once
406 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.

Estimated RAM for a modded Minecraft server by pack size, four players
Mods (4 players)RAMOur shortest passOur month pass
506 GB£2.00 a day£14.68renewing, £16.32paid once
1508 GB£2.00 a day£19.58renewing, £21.76paid once
30010 GB£2.70 a day£24.48renewing, £27.20paid once
45016 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
  • -Xmx is the most memory the server may use. This is the number that matters.
  • -Xms is what it starts with. Mojang's command sets both to the same figure.
  • Use G for gigabytes or M for megabytes: -Xmx3G and -Xmx3072M mean 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-distance is 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-distance controls 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 --memory in 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

Minecraft server memory and lag messages, and what they mean
You seeWhat it meansWhat to do
java.lang.OutOfMemoryError: Java heap spaceWhat it meansThe server ran out of memoryWhat to doMore RAM, a lower view-distance, or fewer mods
Can't keep up! Is the server overloaded? Running ...ms or ... ticks behindWhat it meansTicks are taking too long. Usually CPU, entities or a busy farm, not memoryWhat to doLower simulation-distance, clear mob piles, check which chunk is busy
A single server tick took ... secondsWhat it meansOne tick froze for a minute and the watchdog stopped the serverWhat 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 errorsWhat it meansLag between player and serverWhat 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.

Related guides