Adjust process OOM-killer scores based on process names and other attributes
Arch Linux: https://aur.archlinux.org/packages/choomd-git
Edit /etc/choomd.toml to your liking, for example:
# Sacrifice firefox tabs before the browser
[rules.firefox-contentproc]
command_line_file_name = [ 'firefox', 'firefox-bin' ]
command_line_argument = [ '-contentproc' ]
oom_score_adj = 500
[rules.firefox]
command_line_file_name = [ 'firefox', 'firefox-bin' ]
oom_score_adj = 450More on configuration here: https://github.com/futpib/choomd/blob/master/etc/choomd.toml
Enable the service:
systemctl enable --now choomdRUST_LOG=debug choomd --config-file ./choomd.tomlAvoid setting negative or low (< 200) oom_score_adj as you may create an unkillable monster
Alt+SysRq+fkernel hotkey that triggers OOM killerOOMPolicyandDefaultOOMPolicysystemd options that make systemd terminate siblings of an OOM-killed processOOMhtopcolumn to see which processes are next in line for the OOM kill
Change OOM daemon. By analogy with choom command.