Killed / Out of memory: Killed process (Linux OOM killer)
The kernel ran out of memory and killed a process to recover — the program just prints “Killed” (exit code 137).
Seen on:
Linux
Meaning
When RAM and swap are exhausted, the OOM killer picks the biggest process and sends SIGKILL. There’s no stack trace; the evidence is in the kernel log. Small VPSs without swap hit this during builds (npm, Composer, webpack) and database spikes.
Common causes
- Server has too little RAM / no swap
- Memory-hungry build steps (webpack, tsc, Composer)
- Memory leak in a long-running process
- Too many worker processes (PHP-FPM, Gunicorn) for the RAM
⚡ Quick fix
- Confirm:
dmesg -T | grep -i -E "killed process|oom" - Add swap on small servers
- Reduce workers / limit process memory
- Build on CI instead of the production server
Detailed fix by platform
Linux
- Add a 2 GB swap file:bash
sudo fallocate -l 2G /swapfile && sudo chmod 600 /swapfile sudo mkswap /swapfile && sudo swapon /swapfile echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab free -h
How to diagnose
- Kernel log — dmesg / journalctl -k for OOM entries
- Victim — Which process and how big?
- Capacity — RAM, swap, worker counts
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026