forked from rfjakob/earlyoom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
earlyoom.1
158 lines (141 loc) · 2.89 KB
/
earlyoom.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
.TH earlyoom 1
.SH NAME
earlyoom \- Early OOM Daemon
.SH SYNOPSIS
.B earlyoom
.RB [ OPTION ]...
.SH DESCRIPTION
The oom\-killer generally has a bad reputation among Linux users. One may have
to sit in front of an unresponsive system, listening to the grinding disk for
minutes, and press the reset button and get back to what was doing quickly
after running out of patience.
.B earlyoom
checks the amount of available memory and free swap 10 times a second.
If both are below 10%, it will kill the largest process. The percentage value
is configurable via command line arguments.
.SH OPTIONS
.TP
.BI \-m " PERCENT"
set available memory minimum to
.I PERCENT
of total (default 10 %)
.TP
.BI \-s " PERCENT"
set free swap minimum to
.I PERCENT
of total (default 10 %)
.TP
.BI \-M " SIZE"
set available memory minimum to
.I SIZE
KiB
.TP
.BI \-S " SIZE"
set free swap minimum to
.I SIZE
KiB
.TP
.B \-k
use kernel oom killer instead of own user\-space implementation
.TP
.B \-i
user\-space oom killer should ignore positive
.I oom_score_adj
values
.TP
.B \-d
enable debugging messages
.TP
.B \-v
print version information and exit
.TP
.BI \-r " INTERVAL"
memory report interval in seconds (default 1), set to 0 to disable completely
.TP
.B \-p
set niceness of earlyoom to -20 and
.I oom_score_adj
to -1000
.TP
.B \-h
this help text
.SH EXIT STATUS
.TP
.B 0
Successful program execution.
.TP
.B 1
Usage printed (using
.BR \-h ).
.TP
.B 2
Switch conflict.
.TP
.B 4
Could not cd to
.I /proc
.TP
.B 5
Could not open
.I proc
.TP
.B 7
Could not open
.I /proc/sysrq-trigger
.TP
.B 13
Unknown options.
.TP
.B 14
Wrong parameters for other options.
.TP
.B 15
Wrong parameters for memory threshold.
.TP
.B 16
Wrong parameters for swap threshold.
.TP
.B 102
Could not open
.I /proc/meminfo
.TP
.B 103
Could not read
.I /proc/meminfo
.TP
.B 104
Could not find a specific entry in
.I /proc/meminfo
.TP
.B 105
Could not convert number when parse the contents of
.I /proc/meminfo
.SH Why not trigger the kernel oom killer?
Earlyoom does not use
.I echo f > /proc/sysrq-trigger
because the Chrome people made their browser always be the first (innocent!)
victim by setting
.I oom_score_adj
very high. Instead, earlyoom finds out itself by reading through
.I /proc/*/status
(actually
.I /proc/*/statm
, which contains the same information but is easier to parse programmatically).
Additionally, in recent kernels (tested on 4.0.5), triggering the kernel oom
killer manually may not work at all. That is, it may only free some graphics
memory (that will be allocated immediately again) and not actually kill any
process.
.SH MEMORY USAGE
About 0.6MB RSS. All memory is locked using
.I mlockall()
to make sure earlyoom does not slow down in low memory situations.
.SH AUTHOR
The author of earlyoom is
Jakob Unterwurzacher
.ME .
This manual page was written by
Yangfl
.ME ,
for the Debian project (and may be used by others).