Process thread count

Thread count per pid and system-wide; runaway threads exhaust kernel.pid_max

ps -o nlwp= -p <pid>; ps -eLf | wc -l

tool
troubleshooting32 commands
tags
troubleshootingperformancedebugkernel

More troubleshooting commands

  • while sleep 5; do ps -o rss= -p <pid> | awk '{print strftime("%T"),$1/1024"MB"}'; done

    Sample RSS every 5s to confirm a real leak (monotonic growth) vs steady churn

  • cat /proc/<pid>/smaps_rollup

    One-shot Rss/Pss/Swap totals without parsing full smaps; cheap on huge maps

  • pmap -x <pid> | sort -k3 -rn | head

    Top RSS mappings by region; spot a leaking heap, mmap or shared lib bloat

  • slabtop -o -s c | head -20

    Sort slab caches by size; dentry/inode bloat explains kernel memory pressure

  • grep -E 'Slab|SReclaimable|SUnreclaim' /proc/meminfo

    Split slab into reclaimable vs unreclaimable; high SUnreclaim = real kernel leak

all 32 troubleshooting commands