diff options
author | Jian-Hong Pan <jhp@endlessos.org> | 2022-12-12 15:21:23 +0800 |
---|---|---|
committer | Florian Müllner <fmuellner@gnome.org> | 2023-02-13 17:17:32 +0100 |
commit | 4aedf863537dac29057b1ba75218e0aa7baed2f8 (patch) | |
tree | 8ff6e0874d6ab8804572e342155a20009e61d158 | |
parent | 06fd932dd9bbc30f30cc141275e908dd7060f20c (diff) | |
download | gnome-shell-4aedf863537dac29057b1ba75218e0aa7baed2f8.tar.gz |
data: Lower down gnome-shell process' OOM score
When GNOME shell runs on a less memory system (for example 3 GB RAM), it
is usually killed by the kernel OOM-killer easily. Because, it has a
higher OOM score. However, GNOME desktop environment cannot do anything
when the GNOME shell is killed.
This commit adjusts and lowers down gnome-shell process' OOM score to
avoid being killed by the kernel OOM-killer too early. In other words,
sacrifices other processes first.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2582>
(cherry picked from commit 09c8fb541484f34a496809bc1c5708c90e9cb65c)
-rw-r--r-- | data/org.gnome.Shell@wayland.service.in | 3 | ||||
-rw-r--r-- | data/org.gnome.Shell@x11.service.in | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/data/org.gnome.Shell@wayland.service.in b/data/org.gnome.Shell@wayland.service.in index 38887eb19..76d5ccb1b 100644 --- a/data/org.gnome.Shell@wayland.service.in +++ b/data/org.gnome.Shell@wayland.service.in @@ -32,3 +32,6 @@ ExecStopPost=-/bin/sh -c 'test "$SERVICE_RESULT" != "exec-condition" && systemct Restart=no # Kill any stubborn child processes after this long TimeoutStopSec=5 + +# Lower down gnome-shell's OOM score to avoid being killed by OOM-killer too early +OOMScoreAdjust=-1000 diff --git a/data/org.gnome.Shell@x11.service.in b/data/org.gnome.Shell@x11.service.in index 7310f6608..078d87a3c 100644 --- a/data/org.gnome.Shell@x11.service.in +++ b/data/org.gnome.Shell@x11.service.in @@ -37,3 +37,6 @@ Restart=always RestartSec=0ms # Kill any stubborn child processes after this long TimeoutStopSec=5 + +# Lower down gnome-shell's OOM score to avoid being killed by OOM-killer too early +OOMScoreAdjust=-1000 |