Minecraft

My server restarts with OutOfMemory every few hours — how do I fix it?

A server that restarts every few hours with an OutOfMemory error is running out of RAM under load. It's a fixable problem — usually a matter of giving the JVM headroom, reducing load, or right-sizing your RAM.

Why it happens

Under player activity and content load, the server's memory use climbs until it exceeds what's available, and the JVM crashes with OutOfMemory. That can be because the buffer is too tight, the server is doing too much, the plan is genuinely undersized, or a mod/plugin is leaking.

How to fix it

  1. Make sure your RAM buffer is set in the Startup tab — 300–500MB for servers under 3GB, 1000–3000MB for 3–10GB+ — so the JVM has headroom.
  2. Reduce load: lower view-distance, trim heavy mods/plugins, and pre-generate the world.
  3. If it's genuinely too small for your content, upgrade RAM to match your setup.
  4. Check for a leaking mod or plugin with a heap report (/spark heapsummary).

Tip: A scheduled restart helps as a stopgap, but persistent OutOfMemory means the RAM is undersized or something is leaking — treat the cause, not just the symptom.

Frequently asked questions

Will a scheduled restart fix it? It buys time by clearing memory periodically, but it's a band-aid. Repeated OOM means undersized RAM or a leak that needs addressing.

How do I know if I just need more RAM? If the buffer is set correctly and there's no leaking mod/plugin, yet it still runs out under normal use, your content needs more RAM than the plan provides — upgrade.