Out of heap memory (OutOfMemoryError: Java heap space)
- Platforms
- Paper · Purpur · single server
- Verified
- Verified
- Confidence
- Confidence 95%
What it looks like in the log
Any one of these lines is enough. The agent matches them locally, on your server.
logs/latest.log
[WARN] java.lang.OutOfMemoryError:
Symptoms
- The server lags heavily, then crashes or stops responding
- In the log: “java.lang.OutOfMemoryError: Java heap space” (or “GC overhead limit exceeded”)
Cause
The JVM could not allocate an object on the heap: the configured -Xmx is too small for the current load, or memory is being held by a leak (a plugin, a huge number of entities/chunks).
Possible causes
- -Xmx is too small for the number of players, plugins and loaded chunks
- A memory leak in a plugin (memory grows from restart to restart until OOM)
- A one-off overload: pre-generation/WorldEdit over a large area, thousands of entities in one place
How to fixMedium risk
- Restart the server: after an OutOfMemoryError the JVM state is unreliable and data may not be saved.
- Check
-Xmxin the launch command: it must leave headroom below the container/VDS limit (1–1.5 GB for off-heap); if there is headroom, increase-Xmx(and set-Xmsto the same value). - If OOM recurs with enough heap, look for a leak:
/spark heapsummaryshortly before the crash or a heap dump (-XX:+HeapDumpOnOutOfMemoryError); compare with recently installed/updated plugins. - Check whether a heavy operation (pre-generation, WorldEdit) was running at the time of the crash, and limit it.
Translated from the Russian original; log lines are quoted verbatim.