BIENVENUE10valid for the first month only! on all offersView plans
Skip to content
← Knowledge base

Minecraft: the server crashes from lack of RAM (OutOfMemory)

Increase Xmx in the Pelican panel and use Aikar's JVM flags to avoid OutOfMemoryError.

Minecraft: the server crashes from lack of RAM (OutOfMemoryError)

The java.lang.OutOfMemoryError: Java heap space error in the console means the JVM has exhausted its allocated memory. The server freezes and then restarts.

Cause / The problem

Either the allocated RAM (-Xmx) is too small for the number of players and mods, or it’s too high relative to the plan’s total RAM (the system kills the process via the OOMKiller).

Solution

  1. Increase -Xmx in the Pelican panel → Startup tab → Server Memory Limit field. Set the value based on your server:
    • Vanilla / 10 players: 2-3 GB
    • Paper / 30 players: 4-6 GB
    • Heavy modpack: 6-10 GB
  2. Never exceed 80% of the plan’s RAM. Keep 1 to 1.5 GB for the system and the JVM itself. On an 8 GB plan, allocate 6 GB at most.
  3. Align Xms with Xmx. Having -Xms = -Xmx avoids heap-resizing pauses. Aikar’s flags recommend this equality.
  4. Use Aikar’s flags to optimize the garbage collector. Grab them from docs.papermc.io/paper/aikars-flags and paste them into the panel’s JVM Arguments field, adjusting the Xmx and Xms values.
  5. Cut consumption if you can’t add more RAM:
    • Lower view-distance (immediate 1-2 GB saving).
    • Reduce the number of preloaded chunks.
    • Limit the heavy mods/plugins identified with Spark.
  6. Detect a memory leak. If RAM usage climbs continuously to a crash despite having enough memory, a plugin is leaking. Profile with /spark health to see the curve.

Keep an eye on RAM in the panel: it should oscillate and drop after each garbage collection, not climb steadily.

oneSubnet

French hosting provider in Paris. High-performance game and voice servers.

SERVICES

Resources

LEGAL

All systems operational