Minecraft Java Edition can run into an error state called “Out of Memory” or “OoM” when there are either insufficient resources for the JRE to manage the RAM used by the server or the server itself doesn’t have enough remaining RAM to store additional data. There can be a few reasons for this, ranging between there being an insufficient total amount of RAM allocated to your server, there being inefficient CPU time to manage the RAM usage of your server, and there being insufficient RAM available to the JRE itself.
Out of memory errors are often caused by the following situations: The JRE runs alongside the server and manages the interface between the server software and the OS. Modern Minecraft versions have become more reliant on the optimizations that the JRE can provide, and that makes the JRE more reliant on server resources like RAM and CPU time. The JRE runs alongside the server and manages the interface between the server software and the OS. Modern Minecraft versions have become more reliant on the optimizations that the JRE can provide, and that makes the JRE more reliant on server resources like RAM and CPU time. It may be as simple as your server not having enough RAM to store the data it needs. If you’ve tried adjust the above and you’re still experiencing OoM errors, then you may need to upgrade your server. Sometimes the server will “leak” memory. That happens when data is added to RAM and is never “released”, or allowed to be deleted after it’s no longer needed. This can be an issue with the Vanilla server itself, the 3rd party server software you’re using /(Forge/Paper/Fabric/, or with a Mod/Plugin you’ve added. If the leak is slow, you can mitigate it by having a regularly scheduled server restart. Under ideal conditions your server should be able to clear out any un-needed data from RAM when it needs space to store more, but the longer a program is running the more likely it is for small amounts of mis-marked data to accumulate. This may not be a typical “leak” where it’s a relatively large amount of data coming from one source, but instead just general data that wasn’t or can’t be cleared correctly.Not enough RAM for the JRE
If the server software itself uses all of the allocated RAM before the JRE can clear it, then the JRE will slow down and end up unable to keep up with the server software. You can prevent this by adjusting the Max Ram Percentage to leave more ram for the JRE.Not enough CPU for the JRE
If your server is overloaded then the JRE may have difficulty keeping up with it’s task of clearing the unused RAM. You can try to optimize your server to reduce the CPU usage or make the JRE more efficient at clearing the unused RAM by using flags like Aikar’s Flags.Not enough RAM for the server
As a general rule, your server will use all of the RAM it has allocated and only clear it when there’s a need to store new data. That’s why making sure you have enough RAM and CPU time available for the JRE is important. But that can only go so far, and the amount needed for your server can be affected by te following:General Memory Leak
If it reaches the point that your server crashes more often than 24 hours, you may want to try the following troubleshooting steps.
How you disable it can vary.Server Uptime
The easiest way to combat this is to give your server a regular restart using a restart schedule.
