Out of Memory

The server crashes with an OutOfMemoryError. Java ran out of heap space, either because too little RAM was allocated, or because something is leaking memory faster than it can be reclaimed.

Ce înseamnă această eroare?
The server runs inside a Java heap capped by the -Xmx flag. 'Java heap space' means the live data exceeded that cap. The cause is either a genuinely undersized heap or a memory leak from a mod, plugin, or runaway chunk loading.
Java heap space
Cele mai frecvente cauze
  • An -Xmx value too low for the modpack or player count.
  • A memory leak in a mod or plugin.
  • Too many chunks kept loaded (high view distance, chunk loaders).
  • A large modpack that simply needs more heap.
  • No headroom left for the operating system, causing thrash.
Cum să diagnostichezi
  1. Check the -Xmx value in your start script.
  2. Monitor RAM over time, a steady climb that never drops signals a leak.
  3. Use spark's memory inspector or capture a heap dump to find the culprit.
  4. Note whether the crash follows a specific action (a plugin, a chunk loader).
Soluții recomandate
  • Increase -Xmx sensibly
    Raise the heap, but leave 1-2 GB free for the OS, allocating everything backfires.
  • Use Aikar's flags
    Apply the well-known Aikar GC flags for far more stable memory behavior.
  • Find the leak
    If RAM only ever climbs, profile with spark and remove the leaking mod/plugin.
  • Reduce loaded chunks
    Lower view/simulation distance and audit chunk loaders to cut memory pressure.
Întrebări frecvente

Vanilla/Paper: 2-4 GB is plenty for small servers. Big modpacks often want 6-10 GB.

No. Over-allocating lengthens garbage-collection pauses and starves the OS. Match RAM to need.

A tuned set of G1GC JVM flags that dramatically smooth out garbage collection for Minecraft servers.