diff --git a/MANPAGE.md b/MANPAGE.md index f7a4f1e..2e8e567 100644 --- a/MANPAGE.md +++ b/MANPAGE.md @@ -26,7 +26,7 @@ If there is a failure when trying to kill a process, **earlyoom** sleeps for # OPTIONS #### -m PERCENT[,KILL_PERCENT] -set available memory minimum to PERCENT of total (default 10 %). +set available memory minimum to PERCENT of MemAvailable+AnonPages (as reported in **/proc/meminfo**) at the time of initialization (default 10 %). earlyoom starts sending SIGTERM once **both** memory **and** swap are below their respective PERCENT setting. It sends SIGKILL once **both** are below their respective diff --git a/main.c b/main.c index 8540654..72a9bce 100644 --- a/main.c +++ b/main.c @@ -291,8 +291,8 @@ int main(int argc, char* argv[]) } // Merge "-M" with "-m" values if (have_M) { - double M_term_percent = 100 * mem_term_kib / (double)m.MemTotalKiB; - double M_kill_percent = 100 * mem_kill_kib / (double)m.MemTotalKiB; + double M_term_percent = 100 * mem_term_kib / (double)m.UserMemTotalKiB; + double M_kill_percent = 100 * mem_kill_kib / (double)m.UserMemTotalKiB; if (have_m) { // Both -m and -M were passed. Use the lower of both values. args.mem_term_percent = min(args.mem_term_percent, M_term_percent);