oom_badness(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, welcome to oom_badness(9) from the Kernel API Manual β€” yes, the whole page is about one very specific OOM heuristic, and it is lowkey giving main character energy. πŸ’…βœ¨

πŸ’– NAME πŸ’–

oom_badness β€” the heuristic function that determines which candidate task to kill. No cap, that's the whole vibe. 🫢

✨ SYNOPSIS ✨

long oom_badness (struct task_struct *p , unsigned long totalpages );

🌸 ARGUMENTS 🌸

  • p β€” the task_struct of which task we should calculate. Like, whose badness are we even computing, bestie? That's the task in question. πŸŽ€
  • totalpages β€” total present RAM allowed for page allocation. That's the memory ceiling in the mix. ✨

πŸŽ€ DESCRIPTION πŸŽ€

okay so real talk: the heuristic for determining which task to kill is made to be as simple and predictable as possible. That's the whole design brief, and honestly? iconic. πŸ’…

The goal is to return the highest value for the task consuming the most memory to avoid subsequent oom failures. So yeah β€” biggest memory goblin gets the highest value, and that's on purpose to dodge the next oom situation. πŸ”₯

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./mm/oom_kill.c is the source-y bestie, and then there's the whole friend group:


shoutout to the source/version ./mm, the date October 2026, and oom_badness(9) β€” that's the footer, bestie, and that's a wrap πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from