Find the largest memory mappings
Sort mappings by RSS to spot a leaking heap, a large mmap or a bloated shared library.
pmap -x <pid> | sort -k3 -rn | head
- tool
- troubleshooting32 commands
More troubleshooting commands
-
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.
-
cat /proc/<pid>/oom_score /proc/<pid>/oom_score_adjA higher oom_score means the process is more likely to be killed; oom_score_adj -1000 protects it from the OOM killer.
-
cat /sys/fs/cgroup/<name>/memory.events | grep -E 'oom|max'Read oom_kill and max counters for a cgroup to see a pod hitting memory.max before the whole node runs out of memory.