Interview Prep/Linux/Processes, memory and OOM

Memory usage keeps climbing but no process in `top` shows high RSS.

AdvancedTroubleshootingProcesses, memory and OOM
Answer

Likely causes → Kernel memory: slab caches (dentries/inodes from millions of files), a leaking kernel module, tmpfs/shm usage, or huge pages reserved.

Diagnose →

grep -E 'Slab|SReclaimable|SUnreclaim|Shmem|HugePages_Total|Hugetlb' /proc/meminfo
sudo slabtop -o | head -20
df -h -t tmpfs

Fix → Shmem: clean up /dev/shm or tmpfs files. Large SReclaimable dentry cache is reclaimable under pressure (test with echo 2 > /proc/sys/vm/drop_caches, don't schedule it). Growing SUnreclaim suggests a kernel/driver leak: update the kernel or driver.

Prevent → Graph slab and shmem in monitoring, not just process RSS.

All Linux questions Roadmap: Linux

More on Processes, memory and OOM