From 66d24eeeb63490fe16de978160f5e0fbd202d424 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 7 Apr 2024 21:42:34 +0200 Subject: [PATCH] MANPAGE: explain that regexes match against /proc/pid/comm Fixes https://github.com/rfjakob/earlyoom/issues/311 --- MANPAGE.md | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/MANPAGE.md b/MANPAGE.md index ab7dd4c..ccc3545 100644 --- a/MANPAGE.md +++ b/MANPAGE.md @@ -145,13 +145,23 @@ Be sure to check how your environment behaves beforehand. Use to show all processes with the PGID in brackets. #### \-\-prefer REGEX -prefer killing processes matching REGEX (adds 300 to oom_score) +Prefer killing processes whose `comm` name matches REGEX (adds 300 to oom_score). + +The `comm` name is the string in `/proc/pid/comm`. It is the first 15 bytes of the +process name. Longer names are truncated to 15 bytes. + +The `comm` name is also what `top`, `pstree`, `ps -e` show. Use any of these tools +to find the proper `comm` name. + +Example: You want to match `gnome-control-center`, which is longer than 15 bytes: + + earlyoom --prefer '^gnome-control-c$' #### \-\-avoid REGEX -avoid killing processes matching REGEX (subtracts 300 from oom_score) +avoid killing processes whose `comm` name matches REGEX (subtracts 300 from oom_score). #### \-\-ignore REGEX -ignore processes matching REGEX. +ignore processes whose `comm` name matches REGEX. Unlike the \-\-avoid option, this option disables any potential killing of the matched processes that might have occurred due to the processes attaining a high oom_score.