]> git.ipfire.org Git - thirdparty/util-linux.git/blob - sys-utils/choom.1
lscpu: make lookup() use more consistent [coverity scan]
[thirdparty/util-linux.git] / sys-utils / choom.1
1 .TH CHOOM 1 "April 2018" "util-linux" "User Commands"
2 .SH NAME
3 choom \- display and adjust OOM-killer score.
4 .SH SYNOPSIS
5 .B choom
6 .B \-p
7 .I pid
8 .sp
9 .B choom
10 .B \-p
11 .I pid
12 .B \-n
13 .I number
14 .sp
15 .B choom
16 .B \-n
17 .I number
18 .IR command\ [ argument ...]
19
20 .SH DESCRIPTION
21 The \fBchoom\fP command displays and adjusts Out-Of-Memory killer score setting.
22
23 .SH OPTIONS
24 .TP
25 .BR \-p ", " \-\-pid " \fIpid\fP
26 Specifies process ID.
27 .TP
28 .BR \-n , " \-\-adjust " \fIvalue\fP
29 Specify the adjust score value.
30 .TP
31 .BR \-h ", " \-\-help
32 Display help text and exit.
33 .TP
34 .BR \-V ", " \-\-version
35 Display version information and exit.
36 .SH NOTES
37 Linux kernel uses the badness heuristic to select which process gets killed in
38 out of memory conditions.
39
40 The badness heuristic assigns a value to each candidate task ranging from 0
41 (never kill) to 1000 (always kill) to determine which process is targeted. The
42 units are roughly a proportion along that range of allowed memory the process
43 may allocate from based on an estimation of its current memory and swap use.
44 For example, if a task is using all allowed memory, its badness score will be
45 1000. If it is using half of its allowed memory, its score will be 500.
46
47 There is an additional factor included in the badness score: the current memory
48 and swap usage is discounted by 3% for root processes.
49
50 The amount of "allowed" memory depends on the context in which the oom killer
51 was called. If it is due to the memory assigned to the allocating task's cpuset
52 being exhausted, the allowed memory represents the set of mems assigned to that
53 cpuset. If it is due to a mempolicy's node(s) being exhausted, the allowed
54 memory represents the set of mempolicy nodes. If it is due to a memory
55 limit (or swap limit) being reached, the allowed memory is that configured
56 limit. Finally, if it is due to the entire system being out of memory, the
57 allowed memory represents all allocatable resources.
58
59 The adjust score value is added to the badness score before it is used to
60 determine which task to kill. Acceptable values range from -1000 to +1000.
61 This allows userspace to polarize the preference for oom killing either by
62 always preferring a certain task or completely disabling it. The lowest
63 possible value, -1000, is equivalent to disabling oom killing entirely for that
64 task since it will always report a badness score of 0.
65
66 Setting an adjust score value of +500, for example, is roughly equivalent to
67 allowing the remainder of tasks sharing the same system, cpuset, mempolicy, or
68 memory controller resources to use at least 50% more memory. A value of -500,
69 on the other hand, would be roughly equivalent to discounting 50% of the task's
70 allowed memory from being considered as scoring against the task.
71
72 .SH AUTHORS
73 .nf
74 Karel Zak <kzak@redhat.com>
75 .fi
76 .SH SEE ALSO
77 .BR proc (5)
78 .SH AVAILABILITY
79 The \fBchoom\fP command is part of the util-linux package and is available from
80 .UR https://\:www.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
81 Linux Kernel Archive
82 .UE .