Skip to content

Instantly share code, notes, and snippets.

@wknapik
Created October 25, 2018 19:38
Show Gist options
  • Save wknapik/ee45b7b3ce281fa581a0ba59089839c2 to your computer and use it in GitHub Desktop.
Save wknapik/ee45b7b3ce281fa581a0ba59089839c2 to your computer and use it in GitHub Desktop.
Protect a process and its descendants from the oom killer
./oom-protector.sh <executable> <options>
#!/bin/sh
echo -1000 >"/proc/$$/oom_score_adj"
exec "$@"
@wknapik
Copy link
Author

wknapik commented Sep 9, 2022

Or use choom from util-linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment