The Out of Memory crash is one of the most common Minecraft errors. Java games run inside a memory sandbox called the heap — when Minecraft needs more RAM than is allocated, Java throws an OutOfMemoryError and the game crashes. Increasing RAM allocation in the launcher settings is the primary fix.
What does Minecraft Out of Memory mean?
Java has a maximum heap size that limits how much RAM a program can use. By default Minecraft allocates 2GB. Heavy modpacks, large render distances, or resource packs can push usage above this limit, causing a crash with the message 'java.lang.OutOfMemoryError: Java heap space' in the logs.
How to allocate more RAM
In the official Minecraft Launcher: open the launcher, go to Installations, click the three-dot menu on your profile, edit it, and change the JVM Arguments -Xmx value (e.g., -Xmx4G for 4GB). In modded launchers like CurseForge or Prism: look for a RAM slider in the instance settings.
How much RAM to allocate
Vanilla Minecraft: 2–3GB is sufficient. Modpacks: check the pack's recommended allocation (usually 4–8GB). Do not allocate more than 75% of your total system RAM — leaving some for Windows and other processes prevents system instability.
How to fix step by step
- 1Open your Minecraft launcher and go to installation/profile settings.
- 2Increase the maximum memory allocation (JVM -Xmx flag) from the default 2GB to 4GB or more.
- 3Do not allocate more than 75% of your total RAM (e.g., on 8GB system, cap at 6GB).
- 4Close background applications before launching Minecraft to free up available RAM.
- 5For modpacks, check the pack's documentation for recommended RAM allocation.
- 6Update Java — older Java versions have less efficient garbage collection and use more heap.
- 7Reduce render distance and graphics settings if RAM is genuinely limited on your system.
How OUT-OF-MEMORY differs from related codes
- Error IO-NETTY: Minecraft lost connection with an io.netty network exception — often timeout or forced disconnect. (server or client)
- Error LOGIN-FAILED: Minecraft could not sign in to Microsoft account. (server or client)