Fixing OOM Killer exit code 137 Crashes on Minecraft Paper and Modrinth Modpacks
OOM Killer exit code 137 crashes on Minecraft Paper and Modrinth modpacks are caused by insufficient RAM. This guide explains how to diagnose, optimize JVM settings, and configure...
Does your Minecraft server frequently crash with "Killed: 9" or "exit code 137"? This is a classic sign of the Linux OOM Killer (Out of Memory Killer) terminating the Java process due to insufficient RAM. This guide explains how to diagnose and fix this issue on DPTCloud infrastructure, particularly for Minecraft Paper and popular Modrinth modpacks.
Understanding OOM Killer and exit code 137
On Linux, the OOM Killer is a system protection mechanism. When the system runs low on RAM, it selects the process consuming the most memory and forcefully terminates it. For Minecraft, the Java process (java) is the primary target. When killed, it returns exit code 137 (128 + 9, where 9 is the SIGKILL signal). The log message "Killed: 9" is a clear indicator of this problem.
Common Causes of OOM Killer Crashes on Minecraft Servers
- Insufficient Physical RAM: The most common cause. The server is allocated less RAM than required by the modpack or number of players.
- Lack of Swap Space: No swap space or insufficient swap prevents the system from using virtual memory when physical RAM is full.
- Incorrect JVM Configuration: JVM parameters like
-Xmx(maximum RAM allocated to Java) are set incorrectly, either too high or too low. - Heavy Modpacks: Some Modrinth modpacks (e.g., Infinity Pixelmon, LOTR MiddleEarth Tweaks) have high RAM requirements, especially when combined with many plugins or mods.
Common Troubleshooting Steps
To resolve this issue, follow these steps:
1. Check System Resources
On your VPS, use htop or free -h to monitor RAM usage. If physical RAM is nearly exhausted (under 100MB), you need to increase RAM or reduce the server load.
2. Optimize JVM Configuration
This is the most critical step. In your server's start.sh or startup script, adjust the -Xmx parameter. For example, with 8GB of RAM, set -Xmx7G to allocate 7GB to Java, leaving 1GB for the OS and other processes.
java -Xms4G -Xmx7G -jar paper-26.3.jar noguiImportant: Avoid setting -Xmx too close to the physical RAM limit. DPTCloud recommends leaving at least 1GB of RAM for the operating system.
3. Check and Enable Swap
If no swap is present, create a swap file. For an 8GB RAM system, create a 4GB swap:
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfileTo make swap persistent across reboots, add this line to /etc/fstab:
/swapfile none swap sw 0 04. Review Modpack and Plugin Requirements
For Modrinth modpacks, check the RAM requirements on the project page. If a modpack is too heavy, consider reducing mods or switching to a lighter alternative like Ziptastic, Nearby Delight, Spice of Life.
| Modpack Name | Required RAM | Recommended RAM |
|---|---|---|
| Infinity Pixelmon | 8GB | 10GB |
| LOTRO MiddleEarth Tweaks | 6GB | 7GB |
| Immense Melodies | 4GB | 5GB |
For heavy modpacks, DPTCloud recommends using a Cloud VPS NVMe with at least 16GB RAM to ensure stability.
Ready to deploy on PCIe Gen4 NVMe VPS & 10Gbps Uplinks?
Provision servers in under 60 seconds with edge Anti-DDoS protection and 99.99% SLA uptime.
