Skip to content

Minecraft

Minecraft Server Out of Memory: Heap Errors, Limits and Leaks

Read the actual failure, distinguish JVM exhaustion from an external kill and preserve evidence before changing memory limits.

MinecraftOut of memoryOOMKilledHeapJavaCrash
Reading time
3 min read
Published
Updated
Maintained by
EnderHost Team

Start with the exact error when a Minecraft server runs out of memory. A Java heap-space exception means the JVM could not satisfy a heap allocation; a container or host OOM kill means an external memory boundary was reached. Those failures can need different fixes. Raising the heap to the full hosting limit can make an external kill more likely.

Which failure did you actually see?

Preserve the complete log and timestamp
EvidenceWhat it suggestsNext check
Java heap-space errorHeap allocation failedConfigured Xmx, retained objects and workload at failure
Native-thread/direct-buffer allocation errorMemory or limits outside ordinary heap allocationThread count, native overhead and process limits
OOMKilled or host OOM eventA system/container memory boundary was enforcedActual limit, total charged usage and other processes
Exit code 137 aloneTermination by SIGKILL in common Unix conventionsPanel/host event; this code alone does not prove OOM
Long pauses without an OOM eventAnother performance symptomGC, tick profile, I/O and scheduling evidence

1. Save evidence before restarting repeatedly

  1. Save the final server log, crash report and panel event with UTC time.
  2. Record the startup command, Java version, heap cap and total service limit.
  3. Note player activity, recently changed mods/plugins and any scheduled backup or generation job.
  4. If you administer the OS, inspect its service and kernel logs for termination evidence. Ask the host for the relevant event if you do not have that access.

Do not publish a heap dump or full environment dump casually. It can contain player data, credentials or application secrets, and creating one may need substantial free disk space. Use a protected diagnostic workflow with a clear retention plan.

2. Compare heap with total process usage

Java needs memory outside its managed heap. A game container may also charge other processes or file-backed usage under its configured policy. Identify what the provider’s limit measures before deciding that the graph contradicts the JVM. On a VPS, leave resources for the OS and every colocated service.

Use the Minecraft RAM guide for allocation planning and VPS memory checks when the operating system is under your control. An arbitrary larger Xmx value is not a substitute for this comparison.

3. Distinguish a workload peak from retained growth

An allocation graph rising between garbage collections is normal behavior, not sufficient evidence of a leak. Compare post-collection usage under similar activity and over a useful interval. A pack that loads many dimensions may have a different steady state from an idle lobby. Look for retained growth that continues after the original activity stops.

If the failure followed an extension update, reproduce it on a protected copy with the recorded versions. Change one variable and preserve the results. Removing a content mod directly from the only production world can damage saved data and still fail to establish the original cause.

4. Apply a fix that matches the evidence

  1. For insufficient heap with total headroom, adjust through the supported startup controls and retest.
  2. For external kills, reduce the heap or competing usage, or increase the actual service limit where justified.
  3. For runaway retained data, investigate the responsible workload or extension rather than scheduling endless restarts as the only remedy.
  4. Verify startup, busy play, a clean restart and backup creation after the change.

Compare Minecraft hosting resources when the measured working set needs a larger allocation. Keep the evidence with the decision so later updates can be checked against the same baseline.

Sources and references

Hosting documentation. Publication and update dates reflect this edition.

Related articles

Related topics

Hardware we trust. Software you know.

PREPARING YOUR EXPERIENCE