Guias
Fix "OutOfMemoryError: Java heap space" on a Minecraft Server
OutOfMemoryError: Java heap space means the server needed more memory than its plan has. It usually shows up as lag first, then a crash.
How to spot it
The Console shows java.lang.OutOfMemoryError: Java heap space. The panel can also warn that your world is running out of memory.
A high memory gauge on its own is normal: Java keeps most of its memory reserved. The error message is what counts.
Lower the load first
- Lower View distance and Simulation distance in Settings → Game options, then Save options.
- Look for huge farms, piles of dropped items or too many animals in one place.
- On modded worlds, remove mods you do not use. Big world generation mods cost a lot of memory.
Add RAM
Use Upgrade plan on the Overview. Your world, files and address stay the same, and the extra RAM applies after the next restart. See How to upgrade RAM.
Bigger plans give more RAM. Compare sizes on the plans page.