Fix Linux Killing Your Server (OOM Killer / Out of Memory)
Out of memory: Killed processoom-killerserver randomly stopsIf your server process vanishes with no crash log, Linux probably killed it to save the system from running out of RAM — the "OOM killer". Here's how to confirm and prevent it.
Confirm it was the OOM killer
Check the kernel log for the tell-tale message:
dmesg | grep -i 'killed process'
journalctl -k | grep -i oom
A line like Out of memory: Killed process 1234 (java) confirms the kernel killed your server to free RAM.
Why it happens
The total RAM requested by everything on the box exceeded what's available. Common causes: a server allocated more than the machine has (e.g. -Xmx too high), too many servers on one box, or a memory leak.
How to stop it
- Lower your allocation — leave 1–2 GB for the OS; never give a server all system RAM.
- Add swap — a few GB of swap absorbs spikes (slower, but prevents kills).
- Run fewer services per box, or move to a plan with more RAM.
- Find leaks — if usage only ever climbs, profile the app/plugins.
# add 4G of swap
fallocate -l 4G /swapfile && chmod 600 /swapfile
mkswap /swapfile && swapon /swapfile
The OOM killer targets the process using the most memory — often your game server, even if a different process caused the spike. Fixing total RAM pressure is the real solution.
Confirm with dmesg, then leave headroom for the OS, add swap, and run within the RAM you actually have.
Right-sized RAM, no surprises
Our plans give your server the RAM it needs with room to spare — no OOM kills, protected in Frankfurt.
Frequently asked questions
Why does my game server randomly stop with no crash?
Linux's OOM killer probably terminated it to free RAM. Check dmesg for "Killed process". It means the machine ran out of memory and the kernel killed the biggest process — often your server.
How do I stop the OOM killer killing my server?
Don't over-allocate RAM (leave 1–2 GB for the OS), add some swap to absorb spikes, run fewer services per machine, or move to a plan with more memory. Fix any memory leaks.
Does adding swap fix out-of-memory?
Swap absorbs short spikes and prevents kills, but it's much slower than RAM. It's a safety net, not a substitute for having enough actual memory for your workload.
Related articles
Fix SSH "Connection refused" / "Connection timed out"
SSH "connection refused" vs "timed out" — what each means and the exact steps to fix them.
Read fix Linux & VPSFix "Permission denied" on Linux (chmod & chown Explained)
"Permission denied" on a script or file? Understand chmod/chown and fix it the right way.
Read fix Linux & VPSHow to Check CPU, RAM & Disk Usage on a Linux Server
The essential commands to check CPU, RAM and disk on Linux — and find what's eating them.
Read fix