Created
August 18, 2026 07:03
-
-
Save pkutaj/5ed44a909e56903b0068389121e602cf to your computer and use it in GitHub Desktop.
Explaining OOM Kill in Linux snippet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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