Interactive CLI picks: htop vs. btop vs. atop
Every Linux admin uses htop, but atop is the secret weapon for post-mortem debugging: atop runs as a lightweight daemon logging process-level CPU, RAM, and disk snapshots every 10 minutes so you can replay exactly which process triggered an OOM kill overnight.
# Top 10 processes by resident memory (RSS)
ps aux --sort=-%mem | head -n 11
# Check if the Linux OOM-killer terminated any process
dmesg -T | grep -i -E "killed process|out of memory"
Auto-recover critical daemons with systemd Restart + alerts
Never rely on a human to restart a crashed worker at 4 AM. Set Restart=on-failure and MemoryMax= inside your systemd unit file, and trigger an OnFailure= webhook notification to Slack or Better Stack whenever a restart fires.