Skip to content

Instantly share code, notes, and snippets.

@pkutaj
Created August 18, 2026 07:03
Show Gist options
  • Select an option

  • Save pkutaj/5ed44a909e56903b0068389121e602cf to your computer and use it in GitHub Desktop.

Select an option

Save pkutaj/5ed44a909e56903b0068389121e602cf to your computer and use it in GitHub Desktop.
Explaining OOM Kill in Linux snippet
# check current badness adjustment for a PID
cat /proc/<pid>/oom_score_adj
# make a process nearly immune to the OOM killer
# (requires CAP_SYS_RESOURCE / root)
echo -900 > /proc/<pid>/oom_score_adj
# make a process the preferred victim — useful for a
# deliberately sacrificial "canary" process
echo 1000 > /proc/<pid>/oom_score_adj
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment