Container Basics On Linux (Namespaces/Cgroups)
Track down which container is hogging all the host RAM
🧩 The Challenge
Dealing with a mystery OOM-kill is miserable when you have fifty containers running and no idea which one decided to balloon to 16GB of RAM. Searching through cgroup trees manually is a great way to waste an entire afternoon.
💡 The Fix
Use systemd-cgtop to see exactly how much memory each slice is pulling in real-time. It beats parsing cryptic kernel logs by a long shot.
systemd-cgtop
⚙️ Why It Works
This utility hooks directly into the cgroup v2 hierarchy to give you a live view of CPU, memory, and I/O pressure for every group. It’s basically top for your containers, which is exactly what we need when the host starts stuttering.
🚀 Pro-Tip: Hit ‘k’ to switch the sort order if you need to find the CPU hogs instead of the memory gluttons.
Linux Tips & Tricks | © ngelinux.com | 10/9/2026
