1earlyoom(1) General Commands Manual earlyoom(1)
2
3
4
6 earlyoom - Early OOM Daemon
7
9 earlyoom [OPTION]...
10
12 The oom-killer generally has a bad reputation among Linux users. One
13 may have to sit in front of an unresponsive system, listening to the
14 grinding disk for minutes, and press the reset button to quickly get
15 back to what one was doing after running out of patience.
16
17 earlyoom checks the amount of available memory and free swap up to 10
18 times a second (less often if there is a lot of free memory). If both
19 memory and swap are below 10%, it will kill the largest process (high‐
20 est oom_score). The percentage value is configurable via command line
21 arguments.
22
23 If there is a failure when trying to kill a process, earlyoom sleeps
24 for 1 second to limit log spam due to recurring errors.
25
27 -m PERCENT[,KILL_PERCENT]
28 set available memory minimum to PERCENT of total (default 10 %).
29
30 earlyoom starts sending SIGTERM once both memory and swap are below
31 their respective PERCENT setting. It sends SIGKILL once both are below
32 their respective KILL_PERCENT setting (default PERCENT/2).
33
34 Use the same value for PERCENT and KILL_PERCENT if you always want to
35 use SIGKILL.
36
37 Examples:
38
39 earlyoom # sets PERCENT=10, KILL_PERCENT=5
40
41 earlyoom -m 30 # sets PERCENT=30, KILL_PERCENT=15
42
43 earlyoom -m 20,18 # sets PERCENT=20, KILL_PERCENT=18
44
45 -s PERCENT[,KILL_PERCENT]
46 set free swap minimum to PERCENT of total (default 10 %). Send SIGKILL
47 if at or below KILL_PERCENT (default PERCENT/2), otherwise SIGTERM.
48
49 You can use -s 100 to have earlyoom effectively ignore swap usage: Pro‐
50 cesses are killed once available memory drops below the configured min‐
51 imum, no matter how much swap is free.
52
53 Use the same value for PERCENT and KILL_PERCENT if you always want to
54 use SIGKILL.
55
56 -M SIZE[,KILL_SIZE]
57 As an alternative to specifying a percentage of total memory, -M sets
58 the available memory minimum to SIZE KiB. The value is internally con‐
59 verted to a percentage. You can only use either -m or -M.
60
61 Send SIGKILL if at or below KILL_SIZE (default SIZE/2), otherwise
62 SIGTERM.
63
64 -S SIZE[,KILL_SIZE]
65 As an alternative to specifying a percentage of total swap, -S sets the
66 free swap minimum to SIZE KiB. The value is internally converted to a
67 percentage. You can only use either -s or -S.
68
69 Send SIGKILL if at or below KILL_SIZE (default SIZE/2), otherwise
70 SIGTERM.
71
72 -k
73 removed in earlyoom v1.2, ignored for compatibility
74
75 -i
76 user-space oom killer should ignore positive oom_score_adj values
77
78 -d
79 enable debugging messages
80
81 -v
82 print version information and exit
83
84 -r INTERVAL
85 memory report interval in seconds (default 1), set to 0 to disable com‐
86 pletely. With earlyoom v1.2 and higher, floating point numbers are ac‐
87 cepted. Due to the adaptive poll rate, when there is a lot of free
88 memory, the actual interval may be up to 1 second longer than the set‐
89 ting.
90
91 -p
92 Increase earlyoom's priority: set niceness of earlyoom to -20 and
93 oom_score_adj to -1000
94
95 --prefer REGEX
96 prefer killing processes matching REGEX (adds 300 to oom_score)
97
98 --avoid REGEX
99 avoid killing processes matching REGEX (subtracts 300 from oom_score)
100
101 -h, --help
102 this help text
103
105 0: Successful program execution.
106
107 1: Usage printed (using -h).
108
109 2: Switch conflict.
110
111 4: Could not cd to /proc
112
113 5: Could not open proc
114
115 7: Could not open /proc/sysrq-trigger
116
117 13: Unknown options.
118
119 14: Wrong parameters for other options.
120
121 15: Wrong parameters for memory threshold.
122
123 16: Wrong parameters for swap threshold.
124
125 102: Could not open /proc/meminfo
126
127 103: Could not read /proc/meminfo
128
129 104: Could not find a specific entry in /proc/meminfo
130
131 105: Could not convert number when parse the contents of /proc/meminfo
132
134 Earlyoom does not use echo f > /proc/sysrq-trigger because the Chrome
135 people made their browser always be the first (innocent!) victim by
136 setting oom_score_adj very high. Instead, earlyoom finds out itself by
137 reading through /proc/*/status (actually /proc/*/statm, which contains
138 the same information but is easier to parse programmatically).
139
140 Additionally, in recent kernels (tested on 4.0.5), triggering the ker‐
141 nel oom killer manually may not work at all. That is, it may only free
142 some graphics memory (that will be allocated immediately again) and not
143 actually kill any process.
144
146 About 2 MiB VmRSS. All memory is locked using mlockall() to make sure
147 earlyoom does not slow down in low memory situations.
148
150 If there is zero total swap on earlyoom startup, any -S (uppercase “S”)
151 values are ignored, a warning is printed, and default swap percentages
152 are used.
153
155 The author of earlyoom is Jakob Unterwurzacher ⟨jakobunt@gmail.com⟩.
156
157 This manual page was written by Yangfl ⟨mmyangfl@gmail.com⟩, for the
158 Debian project (and may be used by others).
159
160
161
162 earlyoom(1)