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>
This commit is contained in:
Jian-Hong Pan 2022-12-12 15:21:23 +08:00
parent a1d650ce27
commit 09c8fb5414
2 changed files with 6 additions and 0 deletions

View File

@ -32,3 +32,6 @@ ExecStopPost=-/bin/sh -c 'test "$SERVICE_RESULT" != "exec-condition" && systemct
Restart=no Restart=no
# Kill any stubborn child processes after this long # Kill any stubborn child processes after this long
TimeoutStopSec=5 TimeoutStopSec=5
# Lower down gnome-shell's OOM score to avoid being killed by OOM-killer too early
OOMScoreAdjust=-1000

View File

@ -37,3 +37,6 @@ Restart=always
RestartSec=0ms RestartSec=0ms
# Kill any stubborn child processes after this long # Kill any stubborn child processes after this long
TimeoutStopSec=5 TimeoutStopSec=5
# Lower down gnome-shell's OOM score to avoid being killed by OOM-killer too early
OOMScoreAdjust=-1000