Diagnosing "OutOfMemory" Errors for Minecraft
A common problem with Minecraft, especially once you start to dive into the world of mods, is various "out of memory" errors.
Out of memory errors can sometimes be a little hard to spot if you're not aware of where to look for them. They can be indicated either in a crash report or in the console of your server depending on which one you get.
In this screenshot, the server starts to hang and does not proceed with the startup, nor does it crash. It just sits in a limbo state, but you can see that there is an error:
Caused by: java.lang.OutOfMemorryError: Metaspace.
This server created a crash report, which, if you're not used to reading them, at first glance looks like a mod called
Tech Reborn caused the crash. However, if you scroll down just a little bit in the crash report, you'll see this line:
Caused by: java.lang.OutOfMemoryError: Java heap space, letting you know that this is, in fact, a memory error instead.
Now that you know what to look for, let's look into how to fix these errors. The basic gist is, you need to tell the server how much RAM you're going to allocate to specific aspects of Java. A common problem with modded Minecraft is even though you might have more than enough RAM to run your modpack, the mods are using up all of the available memory and leaving none for Java to do what it needs to. Through a few different Java arguments, you can tell your server "Reserve X amount for Java".
If you have a
Metaspace error, you'll need to increase the "Metaspace Heap Size" field on the "Java Settings" page of your NodePanel.
It's also the
-XX:MaxMetaspaceSize parameter if you don't have access to our NodePanel.
Java 8, uses Metaspace, but it was previously known as
PermGenin prior Java versions.
If you have either a
Java heap space or
GC overhead limit exceeded error, you'll need to increase the "Maximum Ram" field in your Java Settings. This is the
-Xmx parameter typically.
You will not be able to increase the maximum RAM beyond what your Nodecraft bot allows. If you require RAM beyond your plan limit, you will have to upgrade your server.
Knowing what values your server will need is often a matter of trial and error. Modpack authors will often provide the Java arguments they recommend for their modpack in the descriptions or inside a text file in the server files they provide. Chat in with us in our Support Chat if have any questions at all! https://nodecraft.com/support