📖 ~1 min read
Table of contents
Symptom & Impact
Critical services are killed unexpectedly; dmesg shows ‘Out of memory: Kill process’.
Environment & Reproduction
Memory-heavy workloads without limits on small VMs.
free -h
dmesg | grep -i 'killed process' | tail
Root Cause Analysis
Total RSS exceeded available memory and the OOM killer reaped a high-score victim.
Quick Triage
Identify the killed process and current memory pressure.
journalctl -k | grep -i oom
ps -eo pid,rss,comm --sort=-rss | head
Step-by-Step Diagnosis
Profile workload memory and check cgroup limits.
systemd-cgtop -n 1
cat /proc/meminfo

Solution – Primary Fix
Add swap and apply systemd memory limits to runaway services.
Still having issues? Our Server Management team can diagnose and resolve this for you. Get in touch for a free consultation.
fallocate -l 4G /swap1 && chmod 600 /swap1 && mkswap /swap1 && swapon /swap1
systemctl set-property myservice.service MemoryMax=2G

Solution – Alternative Approaches
Move the workload to a larger instance if limits hurt SLAs.
echo 'Resize the VM or container memory class via cloud console / virsh setmem.'
Verification & Acceptance Criteria
No new OOM events under load.
journalctl -k --since='1 hour ago' | grep -i oom
Rollback Plan
Disable the swap file and revert MemoryMax.
swapoff /swap1
systemctl set-property myservice.service MemoryMax=infinity
Prevention & Hardening
Set MemoryMax for all hungry services and monitor pressure.
Automate patch management and compliance across your fleet with our DevOps services.
for s in $(systemctl list-units --type=service --state=running --no-legend | awk '{print $1}'); do systemctl show $s -p MemoryMax; done
Related Errors & Cross-Refs
OOM killer messages, segfaults under load.
Related tutorial: View the step-by-step tutorial for centos-stream-10.
View all centos-stream-10 tutorials on the Tutorials Hub →
Browse all common problems & solutions on the Tutorials Hub.
References & Further Reading
Linux memory tuning notes, systemd resource control.
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.