Track RSS growth over time
Sample RSS every 5 seconds to tell a real leak (steady growth) from normal ups and downs.
while sleep 5; do ps -o rss= -p <pid> | awk '{print strftime("%T"),$1/1024"MB"}'; done
- tool
- troubleshooting32 commands
More troubleshooting commands
-
cat /proc/<pid>/smaps_rollupGet Rss, Pss and Swap totals in one read without parsing the full smaps; cheap even for huge processes.
-
pmap -x <pid> | sort -k3 -rn | headSort mappings by RSS to spot a leaking heap, a large mmap or a bloated shared library.
-
slabtop -o -s c | head -20Sort slab caches by size; large dentry or inode caches often explain kernel memory pressure.
-
grep -E 'Slab|SReclaimable|SUnreclaim' /proc/meminfoSplit slab into reclaimable and unreclaimable parts; a high SUnreclaim points to a real kernel leak.
-
dmesg -T | grep -iE 'killed process|out of memory' | tailSee who the OOM killer picked, with readable timestamps; -T turns kernel time into normal dates.