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