π ~1 min read
Table of contents
Symptom & Impact
Processes are terminated by OOM killer during peaks because swap is absent or disabled.
Environment & Reproduction
Frequent on small VMs or systems with swap turned off for performance tuning.
free -h
swapon --show
dmesg | grep -i -E 'oom|killed process' | tail -n 20
Root Cause Analysis
Insufficient memory headroom and no effective swap fallback during pressure spikes.
Quick Triage
Validate swap availability and vm swappiness settings.
cat /proc/meminfo | grep -E 'MemAvailable|SwapTotal|SwapFree'
sysctl vm.swappiness
vmstat 1 5
Step-by-Step Diagnosis
Identify pressure patterns and highest resident memory consumers.
ps -eo pid,comm,%mem,%cpu --sort=-%mem | head -n 20
grep -RIn "oom|memory" /var/log 2>/dev/null | tail -n 30
cat /etc/fstab

Solution – Primary Fix
Create or re-enable swap and tune swappiness for balanced behavior.
Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

Solution – Alternative Approaches
Use zram swap where disk-based swap is constrained.
sudo apt install -y zram-tools
sudo systemctl enable --now zramswap.service
swapon --show
Verification & Acceptance Criteria
Swap is active and OOM events stop under representative load tests.
swapon --show
free -h
dmesg | grep -i oom | tail -n 10
Rollback Plan
Disable temporary swapfile and remove fstab entry if issues arise.
sudo swapoff /swapfile
sudo rm -f /swapfile
sudo sed -i '//swapfile/d' /etc/fstab
Prevention & Hardening
Right-size memory, set alerts, and test peak workload behavior regularly.
sysctl vm.swappiness
free -h
vmstat 1 5
Related Errors & Cross-Refs
Can coincide with memory leaks and container resource-limit misconfiguration.
Related tutorial: View the step-by-step tutorial for Debian 12.
View all Debian 12 tutorials on the Tutorials Hub β
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
Debian memory management and swap tuning documentation.
Need Expert Help?
If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today β we respond within one business day.