~carstengrohmann/OOMAnalyser

ref: v0.1.0 OOMAnalyser/OOMAnalyser.html -rw-r--r-- 15.3 KiB
044a152f — Carsten Grohmann Add version number to the footer and set the version to "0.1.0" 4 years ago
                                                                                
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
<!DOCTYPE html>
<html lang="en">
<head>
    <script src="__javascript__/OOMAnalyser.js" defer="defer"></script>
    <meta charset="UTF-8">
    <title>OOM Analyser</title>

    <style type='text/css'>
        h1 {
            font-size: 2em;
            margin: 0.67em 0;
        }

        #error_box {
            display: none;
        }

        .kbytes {
            text-align: right;
        }
        .kbytes::after {
            content: " kBytes";
        }

        .pages {
            text-align: right;
        }
        .pages::after {
            content: " pages";
        }

        table {
            border-collapse: collapse;
            padding: 10px;
            table-layout: fixed;
            text-align: left;
            width: 100%;
        }

        svg {
            display: block;
            max-height: 200px;
        }

        th {
            font-weight: bold;
            font-size: large;
            padding: 5px;
        }

        th, td {
            border: 1px solid black;
            word-wrap: break-word;
        }

        .terminal {
            font-family: monospace;
            overflow: auto;
        }

        /* Zebra-Layout */
        tr:nth-child(odd) td:nth-child(2), tr:nth-child(odd) td:nth-child(3) {
            background-color: #f2f2f2;
        }

        .license {
            font-size: small;
            display: none;
        }

    </style>
    <script>
function goBack() {
    window.history.back();
}
    </script>
</head>
<body>


<h1>Analyse and visualise Linux OOM output</h1>

<p>
    This web page splits the content of a Linux Out Of Memory message into
    smaller pieces, aggregates these and presents them in a more human friendly
    format.
</p>

<p>
    <textarea id="textarea_oom" cols="100" rows="20" autocomplete="off" title="OOM input field">Add your OOMhere</textarea>
    <br/>
    <button onclick="OOMAnalyser.oomAnalyser.analyse()" title="Analyse the OOM from the input area">
        Analyse
    </button>
    <button onclick="OOMAnalyser.oomAnalyser.reset()" title="Clean the input area">Reset</button>
    <button onclick="OOMAnalyser.oomAnalyser.copy_example()" title="Copy an example OOM into the input area"
    >Insert example
    </button>
</p>

<div id="analysis">
    <h2>Analysis results</h2>
    <table>
        <!--
        <thead>
        <tr>
            <th scope="col"></th>
            <th scope="col">Entry</th>
            <th scope="col">Description</th>
        </tr>
        </thead>
        -->
        <tbody>

        <!-- Trigger process -->

        <tr>
            <th scope="row" colspan="3">Tigger process</th>
        </tr>
        <tr>
            <td></td>
            <td><span id="trigger_proc_name"></span> (PID <span id="trigger_proc_pid"></span>)</td>
            <td>This process requests memory and is triggering thereby the OOM situation</td>
        </tr>

        <!-- Killed Process -->

        <tr>
            <th scope="row" colspan="3">Killed process</th>
        </tr>
        <tr>
            <td></td>
            <td><span id="killed_proc_name"></span> (PID <span id="killed_proc_pid"></span>)</td>
            <td>Process killed by Linux kernel to satisfy the memory request</td>
        </tr>
        <tr>
            <td>OOM Score<br>(score)</td>
            <td id="killed_proc_score"></td>
            <td></td>
        </tr>
        <tr>
            <td>Virtual Memory <br> (total-vm) </td>
            <td id="killed_proc_vm_kb" class="kbytes"></td>
            <td>Virtual memory used by this process</td>
        </tr>
        <tr>
            <td>Resident anonymous memory <br> (anon-rss) </td>
            <td id="killed_proc_anon_rss_kb" class="kbytes"></td>
            <td>Part of the virtual process memory mapped into RAM</td>
        </tr>
        <tr>
            <td>Resident file mapping memory <br> (file-rss) </td>
            <td id="killed_proc_file_rss_kb" class="kbytes"></td>
            <td>Files which have been mapped into RAM (with
                <a href="http://man7.org/linux/man-pages/man2/mmap.2.html">mmap(2)</a>)
            </td>
        </tr>
        <tr>
            <td>Resident shared memory <br> (shmem-rss) </td>
            <td id="killed_proc_shmem_rss_kb" class="kbytes"></td>
            <td>This may include System V shared memory and shared anonymous memory</td>
        </tr>

        <!-- Memory Chunks -->

        <tr>
            <th scope="row" colspan="3">Memory Usage</th>
        </tr>
        <tr>
            <td style="font-weight: bold">RAM Summary</td>
            <td colspan="2"><div id="svg_ram"></div></td>
        </tr>
        <tr>
            <td style="font-weight: bold">Swap Summary</td>
            <td colspan="2"><div id="svg_swap"></div></td>
        </tr>

        <tr>
            <td style="font-weight: bold">RAM usage</td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td>Active anonymous memory</td>
            <td id="active_anon_pages" class="pages"></td>
            <td>Recently used anonymous memory.<br>
                These memory pages will usually not swapped out.
            </td>
        </tr>
        <tr>
            <td>Inactive anonymous memory</td>
            <td id="inactive_anon_pages" class="pages"></td>
            <td>Least recently used anonymous memory.<br>
                These memory pages can be swapped out.
            </td>
        </tr>
        <tr>
            <td>Isolated anonymous memory</td>
            <td id="isolated_anon_pages" class="pages"></td>
            <td>Memory isolation is used to separate memory between different virtual machines.</td>
        </tr>
        <tr>
            <td>Active Pagecache</td>
            <td id="active_file_pages" class="pages"></td>
            <td>Pagecache that has been used more recently and usually not reclaimed unless absolutely necessary.</td>
        </tr>
        <tr>
            <td>Inactive Pagecache</td>
            <td id="inactive_file_pages" class="pages"></td>
            <td>Pagecache which has been less recently used. It can be reclaimed without huge performance impact.</td>
        </tr>
        <tr>
            <td>Isolated Pagecache</td>
            <td id="isolated_file_pages" class="pages"></td>
            <td>Memory isolation is used to separate memory between different virtual machines.</td>
        </tr>
        <tr>
            <td>Unevictable pages</td>
            <td id="unevictable_pages" class="pages"></td>
            <td>Unevictable memory. It can't be swapped out because the pages are owned by ramfs or protected by
                <a href="http://man7.org/linux/man-pages/man3/mlock.5.html" target="_blank">mlock(3)</a> /
                <a href="http://man7.org/linux/man-pages/man2/shmctl.2.html" target="_blank">shmctl(SHM_LOCK)</a>.
                Unevictable pages are managed by kernels LRU framework.
            </td>
        </tr>
        <tr>
            <td>Dirty</td>
            <td id="dirty_pages" class="pages"></td>
            <td>Memory which is waiting to get written back to the
                disk.
                <sup><a href="#footnote-proc5">[1]</a></sup>
            </td>
        </tr>
        <tr>
            <td>Writeback</td>
            <td id="writeback_pages" class="pages"></td>
            <td>
                Memory which is actively being written back to the disk.
                <sup><a href="#footnote-proc5">[1]</a></sup>
            </td>
        </tr>
        <tr>
            <td>Unstable</td>
            <td id="unstable_pages" class="pages"></td>
            <td>Not yet committed to stable storage.</td>
        </tr>
        <tr>
            <td>Slab Reclaimable</td>
            <td id="slab_reclaimable_pages" class="pages"></td>
            <td>
                Slab is a in-kernel data structures cache. Part of Slab, that might be reclaimed, such as caches.
                <sup><a href="#footnote-proc5">[1]</a></sup>
                <br>
                Additional details are listed in
                <a href="http://man7.org/linux/man-pages/man5/slabinfo.5.html" target="_blank">slabinfo(5)</a> also.
            </td>
        </tr>
        <tr>
            <td>Slab Unreclaimable</td>
            <td id="slab_unreclaimable_pages" class="pages"></td>
            <td>
                Part of Slab, that cannot be reclaimed on memory pressure.
                <sup><a href="#footnote-proc5">[1]</a></sup>
            </td>
        </tr>
        <tr>
            <td>Mapped</td>
            <td id="mapped_pages" class="pages"></td>
            <td>
                Files which have been mapped into memory (with
                <a href="http://man7.org/linux/man-pages/man2/mmap.2.html">mmap(2)</a>), such as libraries.
                <sup><a href="#footnote-proc5">[1]</a></sup>
            </td>
        </tr>
        <tr>
            <td>shmem</td>
            <td id="shmem_pages" class="pages"></td>
            <td>
                Amount of memory consumed in
                <a href="http://man7.org/linux/man-pages/man5/tmpfs.5.html">tmpfs(5)</a>
                filesystems.
                <sup><a href="#footnote-proc5">[1]</a></sup>
            </td>
        </tr>
        <tr>
            <td>Pagetables</td>
            <td id="pagetables_pages" class="pages"></td>
            <td>
                Amount of memory dedicated to the lowest level of pagetables.
                <sup><a href="#footnote-proc5">[1]</a></sup>
            </td>
        </tr>
        <tr>
            <td>Bounce</td>
            <td id="bounce_pages" class="pages"></td>
            <td>
                Memory used for block device "bounce buffers".
                <sup><a href="#footnote-proc5">[1]</a></sup>
            </td>
        </tr>
        <tr>
            <td>free</td>
            <td id="free_pages" class="pages"></td>
            <td></td>
        </tr>
        <tr>
            <td>free_pcp</td>
            <td id="free_pcp_pages" class="pages"></td>
            <td></td>
        </tr>
        <tr>
            <td>free_cma</td>
            <td id="free_cma_pages" class="pages"></td>
            <td></td>
        </tr>
        <tr>
            <td>Total Pagecache</td>
            <td id="pagecache_total_pages" class="pages"></td>
            <td></td>
        </tr>

        <!-- Swap Usage -->

        <tr>
            <td style="font-weight: bold">Swap usage</td>
            <td></td>
            <td></td>
        </tr>
        <tr>
            <td>Swap Total</td>
            <td id="swap_total_kb" class="kbytes"></td>
            <td>Total amount of swap space available.
                <sup><a href="#footnote-proc5">[1]</a></sup>
            </td>
        </tr>
        <tr>
            <td>Swap Free</td>
            <td id="swap_free_kb" class="kbytes"></td>
            <td>Amount of swap space that is currently unused.
                <sup><a href="#footnote-proc5">[1]</a></sup>
            </td>
        </tr>
        <tr>
            <td>Swap Cached</td>
            <td id="swap_cache_kb" class="kbytes"></td>
            <td>Memory that once was swapped out, is swapped back in
                but still also is in the swap file.  (If memory pres‐
                sure is high, these pages don't need to be swapped out
                again because they are already in the swap file.  This
                saves I/O).
                <sup><a href="#footnote-proc5">[1]</a></sup>
            </td>
        </tr>
        <tr>
            <td>Swap Used</td>
            <td id="swap_used_kb" class="kbytes"></td>
            <td>Amount of used swap space w/o cached swap <br>
                (<code>SwapUsed = SwapTotal - SwapFree -SwapCache</code>)
            </td>
        </tr>

        <!-- Operating System -->

        <tr>
            <th scope="row" colspan="3">Operating System</th>
        </tr>
        <tr>
            <td>Kernel</td>
            <td id="kernel_version"></td>
            <td></td>
        </tr>
        <tr>
            <td>Distribution</td>
            <td id="dist"></td>
            <td>Guessed from the kernel version</td>
        </tr>
        <tr>
            <td>Platform</td>
            <td id="platform"></td>
            <td>Guessed from the kernel version</td>
        </tr>
        <tr>
            <td>Page size</td>
            <td id="page_size" class="kbytes"></td>
            <td>Guessed</td>
        </tr>


        <!-- Memory Chunks -->

        <tr>
            <th scope="row" colspan="3">Memory Chunks</th>
        </tr>
        <tr>
            <td></td>
            <td colspan="2" class="terminal">
                <pre id="mem_node_info"></pre>
            </td>
        </tr>

        <tr>
            <th scope="row" colspan="3">Process Table</th>
        </tr>
        <tr>
            <td></td>
            <td colspan="2" class="terminal">
                <pre id="process_table"></pre>
            </td>
        </tr>

        <!-- Hardware Details -->

        <tr>
            <th scope="row" colspan="3">Hardware Details</th>
        </tr>
        <tr>
            <td></td>
            <td colspan="2" class="terminal">
                <pre id="hardware_info"></pre>
            </td>
        </tr>

        <!-- Kernel Call Tree -->

        <tr>
            <th scope="row" colspan="3">Kernel Call Trace</th>
        </tr>
        <tr>
            <td></td>
            <td colspan="2" class="terminal">
                <pre id="call_trace"></pre>
            </td>
        </tr>
        </tbody>
    </table>

    <h2>Footnotes</h2>
    <ol>
        <li id="footnote-proc5"><cite><a href="http://man7.org/linux/man-pages/man5/proc.5.html" target="_blank">
	proc(5) - process information pseudo-filesystem</a></cite> (<a href="#" onclick="goBack()">Go Back</a>)
        </li>
    </ol>
</div>

<div id="error_box">
    <h2>Error messages</h2>
    <div class="terminal" id="__terminal__"></div>
</div>

<hr/>

<div class="footer">
    OOMAnalyser <span id="version"></span> |
    Copyright (C) 2017 Carsten Grohmann |
    <a href="javascript:void(0);" onclick="OOMAnalyser.toggle('license')" title="Show / hide license text">License: MIT</a> |
    <a href="https://github.com/CarstenGrohmann/OOMAnalyser" title="Source code on GitHub">Source Code on GitHub</a>
</div>

<div class="license" id="license">
    <p>
        Copyright (c) 2017 Carsten Grohmann mail &lt;add at here&gt; carsten-grohmann.de
    </p>
    <p>
        Permission is hereby granted, free of charge, to any person obtaining a copy of
        this software and associated documentation files (the "Software"), to deal in
        the Software without restriction, including without limitation the rights to
        use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
        of the Software, and to permit persons to whom the Software is furnished to do
        so, subject to the following conditions:
    </p>
    <p>
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
    </p>
    <p>
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
    </p>
</div>

</body>
</html>