Guides / RAM

Is my Minecraft server lagging from RAM or CPU?

How to tell whether server lag comes from memory or the processor, and what to fix for each.

Updated

Most Minecraft server lag is CPU, not RAM. Minecraft does most of its work on one main thread, so a fast processor matters more than lots of memory.

Check TPS first

TPS (ticks per second) should be 20. Paper shows it with /tps; on other servers use the spark mod or plugin with /spark tps.

  • TPS 20, but players lag: it's network or client-side, not the server.
  • TPS below 20: the server can't keep up. Read on.

Signs it's RAM

  • Memory use stays above 85–90% even after garbage collection
  • Lag spikes come in regular bursts
  • The console shows OutOfMemoryError or the server crashes under load

Fix: add RAM (the RAM calculator gives a sensible size) and use Aikar's flags.

Signs it's CPU

  • TPS drops but memory has plenty of headroom
  • Lag gets worse when players explore new terrain
  • Lag is worse in one place, near farms, redstone or lots of mobs

Fix: lower view and simulation distance, pre-generate the world, and find the cause with a profile.

Profile it

Run /spark profiler start, play normally for a few minutes, then /spark profiler stop. spark gives you a link showing exactly which mods, entities or chunks take the most time.

Settings that help either way

The cheapest fixes are in server.properties. Use the server.properties generator and its Low-RAM preset as a starting point.

Work it out for your server

The free RAM calculator gives you the exact settings for your setup.

Open the RAM calculator →