Catch memory leaks before your server chokes
Process & Resource Monitoring (Top/Htop/Ps/Systemd)
Catch memory leaks before your server chokes
🧩 The Challenge
Dealing with a production app that slowly bloats until the OOM killer nukes it is a nightmare. You never know if it’s a legitimate surge in traffic or a silent memory leak until the whole thing is already unresponsive.
💡 The Fix
Use the RSS value in your process list to track exactly how much physical memory is actually stuck in RAM versus what’s just swapped or cached. It gives you a clear snapshot of the real footprint over time.
ps aux --sort=-rss | head -n 10
⚙️ Why It Works
Sorting by RSS puts the hungriest processes at the top, showing you the resident set size which is the amount of physical memory the process is holding onto. Seeing the change in these numbers over a few hours tells you more than any dashboard alert ever will.
🚀 Pro-Tip: Run this in a loop with watch if you really want to see the leak in action.
Linux Tips & Tricks | © ngelinux.com | 9/23/2026
