oomkill.bt(8)
π oomkill.bt β bestie's guide to the OOM killer
okay so you found the oomkill.bt page in the System Manager's Manual, section 8 (that's the user commands bit, for the sysadmin girlies). it's a bpftrace/eBPF joint and it's about to be your new fave, fr fr. π«Ά
β¨ NAME β¨
oomkill.bt β trace the OOM killer. uses bpftrace/eBPF. that's it, that's the whole vibe. π
πΈ SYNOPSIS πΈ
oomkill.bt
just the one line. no flags, no drama, no options to memorise. iconic honestly. π
π DESCRIPTION π
so like, this little icon traces the kernel out-of-memory killer β yes, the guy who shows up when your RAM situation is giving absolutely not β and prints the basic deets, including the system load averages at the time of the OOM kill. π«
why do you care about load averages, bestie? because they give you context on the system state at that moment: was it getting busier, or was it steady? that's literally what load averages tell you. so you can go "ah, it was climbing the whole time" or "no, it was chill and then just died," and either way you're now the main character of the postmortem. π
this tool is also lowkey perfect to customize for investigations, and that's not me being vague, that's the manpage: for example, by adding other task_struct details at the time of the OOM, or by adding other commands to run at the shell. go off, make it yours. β¨
β οΈ since this uses BPF, only the root user can use this tool. no root, no tool, no exceptions, sorry babe. π
π§ REQUIREMENTS π§
CONFIG_BPFbpftrace
that's the whole checklist. two things. slay. β
π EXAMPLES π
trace OOM kill events:
# oomkill.bt
just run it as root and watch the chaos unfurl. π
π FIELDS π
here's what all the output lines mean, so you can read it like a pro:
- Triggered by ... β the process ID and process name of the task that was running when another task was OOM killed. so, the bystander. the witness. the "not me" of the situation. π
- CGROUP ... β if the OOM occurs in the memory cgroup, display the memory cgroup information.
- OOM kill of ... β the process ID and name of the target process that was OOM killed. that's the one who got got. π
- loadavg β contents of
/proc/loadavg. the first three numbers are the 1, 5, and 15 minute load averages (where the average is an exponentially damped moving sum, and those numbers are constants in the equation); then there's the number of running tasks, a slash, and the total number of tasks; and then the last number is the last PID to be created.
π¦ OVERHEAD π¦
Negligible. β¨ not even a blip. your system won't notice. periodt.
π SOURCE π
this is from bpftrace.
https://github.com/bpftrace/bpftrace
also look in the bpftrace distribution for a companion _examples.txt file containing example usage, output, and commentary for this tool. it's giving free extra lore, go read it. π
this is a bpftrace version of the bcc tool of the same name. the bcc tool may provide more options and customizations β so if you're craving more knobs, that's where to look.
https://github.com/iovisor/bcc
πΈ OS πΈ
Linux
π STABILITY π
Unstable β in development.
so like, it's growing, it's evolving, it's on its journey. use it, love it, but know it's still cooking. π§βπ³
π«Ά AUTHOR π«Ά
Brendan Gregg, Rong Tao
legends, no cap. π
π₯ SEE ALSO π₯
and that's the whole page, bestie!! π this one's from the USER COMMANDS section, dated 2018-09-07, and it lives in the System Manager's Manual alongside its fellow section-8 girlies. go trace some OOM kills and stay hydrated. πβ¨π
π¦ where this page comes from
- alpine 3.24: bpftrace-tools-doc 0.26.1-r0 Β· Apache-2.0
- arch rolling: bpftrace 0.27.0-2 Β· Apache-2.0
- centos-stream 10: bpftrace 0.26.1-1.el10 Β· Apache-2.0
- centos-stream 9: bpftrace 0.26.1-1.el9 Β· ASL 2.0
- nixos 26.05: bpftrace 0.25.1
- nixpkgs unstable: bpftrace 0.27.1
- ubuntu resolute: bpftrace 0.25.0-1ubuntu1 Β· Apache-2.0
- ubuntu stonking: bpftrace 0.25.0-1ubuntu2 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms