Crash help

Minecraft crash: OutOfMemoryError, Java heap space

The game used all the memory the launcher gave it. Give Minecraft more RAM in your launcher, or remove heavy mods.

Updated October 2, 2026. Fabric, NeoForge and Forge.

What you see

The game freezes for a while, then closes. The crash report or log has:

java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: GC overhead limit exceeded

Long freezes and stutter before the crash are the same problem starting: Java spends more and more time freeing memory.

Why it happens

Fix it

  1. Give the game more memory, in the settings of the instance or profile:
    • CurseForge app, Modrinth App, Prism Launcher: the memory (RAM) slider.
    • Official launcher: Installations, edit the installation, More options, and in JVM arguments change -Xmx2G to -Xmx6G.
  2. As a guide: around 4 GB for a few dozen mods, 6 to 8 GB for a large modpack. Leave 2 to 4 GB for the rest of the computer.
  3. Do not give it all your RAM. Above what the pack needs, more memory does not help and can make pauses longer.
  4. Still crashing with enough memory: lower render distance, remove high resolution resource packs, and look for a mod that leaks.

Let the game tell you

The Modkeel Companion tells a memory crash apart from a mod crash on the next start, so you do not remove mods that were not at fault, and it shows the worst lag spikes of a session with the mods whose code ran during them. Free and open source, for Fabric, NeoForge and Forge.

Other crashes