It is the question we hear most often when someone picks a game server. The honest answer is: it depends. But on things you can estimate quite well before you buy.
What uses memory
The RAM of a Minecraft server goes mainly into three things:
- loaded chunks: every player keeps the area around them loaded, so how spread out players are matters more than how many there are;
- mods and plugins: each one adds blocks, entities and data to keep in memory;
- view distance (
view-distanceandsimulation-distance): doubling it means loading many more chunks.
A starting estimate
These are rough figures, not rules: every server is different.
- Vanilla or Paper with a few friends: a couple of GB is often enough.
- A server with plugins and a small or medium community: 4–6 GB is a good starting point.
- Light modpacks: 6–8 GB.
- Large modpacks with hundreds of mods: 8–12 GB and more. Many modpacks state the recommended RAM on their server pack page: start from there.
More RAM does not mean less lag
Minecraft lag very often comes from the CPU, not from memory: the core of the server runs on a single thread that has to complete 20 ticks per second. When a tick takes too long, everything slows down, even with plenty of free RAM.
In fact, giving Java far more memory than it needs can make things worse, because the garbage collector has to manage a huge heap. The right amount of RAM and a fast CPU beat a mountain of RAM.
How to find out what is going on
- Watch the game panel's console: messages like Can't keep up! mean the server cannot keep up with its ticks.
- On Paper,
/tpsand/msptshow how loaded the server is. A profiler such as spark tells you which plugins, entities or chunks cost the most. - If the server crashes with out of memory errors, then yes, it needs more RAM.
Before you add RAM
- Run Paper (or Purpur) instead of the vanilla server: it is far more efficient.
- Lower
view-distanceandsimulation-distance. - Pre-generate the map with a plugin such as Chunky, so the server does not generate terrain while players explore.
- Keep automatic farms and piled-up entities under control.
If the server is still at its limit after all this, it is time for a bigger plan: you can upgrade from the panel without losing your world.