Saturday, May 4, 2024
11
rated 0 times [  11] [ 0]  / answers: 1 / hits: 6748  / 3 Years ago, fri, may 14, 2021, 9:15:36

In response to this.



Take a look to the questions about configuring the OOM killer. For
example: https://unix.stackexchange.com/q/153585/21101



I am looking for what process would be killed first in the case of low memory.


Is there a way to see the OOM score for every process instead of each individually?


More From » memory-usage

 Answers
0

At its simplest, you could just do



cat /proc/*/oom_score


If you want more information - such as the PIDs and command string as well - then maybe a simple loop like



while read -r pid comm; do 
printf '%d %d %s
' "$pid" "$(cat /proc/$pid/oom_score)" "$comm"
done < <(ps -e -o pid= -o comm=)

[#9284] Saturday, May 15, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
afyess

Total Points: 437
Total Questions: 120
Total Answers: 107

Location: San Marino
Member since Fri, Jul 3, 2020
4 Years ago
;