java.lang.OutOfMemoryError: Java heap space

Learn how to resolve the java.lang.OutOfMemoryError: Java heap space on your Minecraft server by adjusting memory allocation or upgrading your plan.

By AwakeNode Team Reviewed by harry Updated 15 June 2026

What is this error?

The java.lang.OutOfMemoryError: Java heap space occurs when your Minecraft server has exhausted the memory (RAM) allocated to the Java Virtual Machine (JVM). When the server attempts to allocate more memory than it has been assigned, the process crashes to prevent system instability.

Common causes

  • High player count: Too many players for the current RAM allocation.
  • Resource-heavy mods/plugins: Complex mods or poorly optimised plugins consuming excessive memory.
  • Large render distances: High view distances significantly increase memory usage.
  • World generation: Rapidly exploring new chunks can spike memory usage.

How to fix it

On AwakeNode

  1. Upgrade your plan: If your server is consistently hitting its limit, navigate to your billing area and upgrade your plan. On AwakeNode, your Xmx (maximum memory) settings are updated automatically to match your new plan, requiring no manual configuration.
  2. Contact Support: If you believe your server should have enough RAM but is still crashing, open a ticket with our support team. We can review your startup flags and JVM settings to ensure they are optimised for your specific modpack or server type.

On other hosts / manually

  1. Edit startup flags: Locate your server's startup script or command line settings. You must manually modify the -Xmx parameter. For example, to set the limit to 4GB, ensure your command includes -Xmx4G.
  2. Optimise your environment: Remove unnecessary plugins or mods that may be causing memory leaks. Reduce the view-distance and simulation-distance in your server.properties file to lower the memory footprint.
  3. Check for memory leaks: If the error occurs over time rather than instantly, a specific plugin may be failing to release memory. Use a profiler tool to identify which process is consuming the most heap space.

Frequently asked questions

Related guides

Ready to host your Minecraft server?

Spin up a high-performance UK server in seconds - AMD Ryzen, NVMe, DDoS protection, and 24/7 support from £1/mo.