OOM score of process

Higher oom_score = likelier victim; set oom_score_adj -1000 to immunize a pid

cat /proc/<pid>/oom_score /proc/<pid>/oom_score_adj

tool
troubleshooting32 commands
tags
troubleshootingmemoryoomkernel

More troubleshooting commands

  • cat /sys/fs/cgroup/<name>/memory.events | grep -E 'oom|max'

    oom_kill/max counters per cgroup; pod hitting memory.max before node-wide OOM

  • lsof +L1 | sort -k7 -rn | head

    df full but du clean? Unlinked files held open by a pid; restart it to reclaim

  • iostat -x 1 | awk '$1!~/^$/{print $1, "util="$NF, "await="$(NF-2)}'

    %util near 100 with rising await = saturated device; correlate with the noisy pid

  • biotop-bpfcc -C 5 1

    bcc biotop: which pid drives block I/O by bytes/latency; modern: bpftrace one-liners

  • conntrack -L 2>/dev/null | wc -l; conntrack -S

    Count tracked flows vs limit; -S shows insert_failed/drop when table full

all 32 troubleshooting commands