java.lang.OutOfMemoryError: Java heap space, what to do

Your Minecraft server crashed with a Java heap space error. Restart once first; if it repeats, you are under-allocated for the pack you are running.

A java.lang.OutOfMemoryError: Java heap space means the JVM asked the operating system for memory, did not get it, and gave up. On a Hostd Minecraft server it always falls into one of two buckets: a one-off after long uptime (transient), or every time you press start (you are under-allocated). The fix is different for each.

Step 1: restart once

Open Dashboard → your server → Console panel, hit Stop, wait five seconds, then Start. A heap exhaustion after several days of uptime is often a slow leak in a single mod or plugin that clears on a fresh JVM. If the server comes back up and stays up, you are done; mark it on the calendar and watch for the next one.

Step 2: if it crashes on boot

When the error fires within the first minute of startup, the JVM never had a chance to leak anything. The pack itself needs more RAM than your plan can give it. Two paths:

  • Trim the pack. Open Files → /data/mods and remove mods you do not actually use. Modpack authors often ship optional addons (alternative storage, secondary worldgen, decorative blocks) that are easy to drop. After deleting, restart.
  • Move to a bigger tier. On the Java ladder, Vanilla (3 GB) is for unmodded servers only, Modded (6 GB) handles light packs, Heavy (10 GB) is the floor for ATM, FTB Skies, Better MC, and RLCraft, and Extreme (14 GB) is for those packs with 10+ active players. Picking a tier has the full table.

Step 3: rule out a runaway mod

A handful of mods are known heap eaters at scale: outdated Pixelmon builds, Ender IO conduit networks past a certain size, Applied Energistics 2 networks with thousands of items being indexed, and any mod that scans the whole world every tick. Install Spark and run:

/spark heapsummary

It prints the top memory holders by class. If a single mod's class is sitting on a gigabyte of objects, that is your leak. Update the mod or remove it.

Why we do not let you change -Xmx directly

Plans are kernel-locked. Your Modded plan has 6 GB available because that is what we have reserved for you in the cgroup; the JVM cannot exceed that even if a flag asks for more. The Files page blocks edits to user_jvm_args.txt, jvm_args.txt, unix_args.txt and the related launcher files for the same reason: setting -Xmx above the plan size only produces the next error (Could not reserve enough space for object heap).

Where to go next

Last updated 2026-05-23. Notice a mistake? Tell us.

Cookies