-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathOOMAnalyser.html
More file actions
2129 lines (1973 loc) · 98.6 KB
/
Copy pathOOMAnalyser.html
File metadata and controls
2129 lines (1973 loc) · 98.6 KB
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
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<!--
HTML for OOMAnalyser
Copyright (c) 2017-2026 Carsten Grohmann
License: MIT (see LICENSE.txt)
THIS PROGRAM COMES WITH NO WARRANTY
-->
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="Analyze and explain Linux kernel Out-of-Memory (OOM) messages. Browser-based tool for parsing OOM logs with detailed memory analysis, process information, and corrective actions. No server upload required.">
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; connect-src 'none'; font-src 'self'; object-src 'none'; media-src 'none'; frame-src 'none'; base-uri 'self'; form-action 'self';">
<title>OOMAnalyser</title>
<script defer src="OOMAnalyser.js"></script>
<style>
/* Use BEM (Block__Element--Modifier) naming convention */
:root {
--tooltip-bg: #555555;
--tooltip-arrow-bg: #555555;
--tooltip-text: #FFFFFF;
--notify-debug-bg: #e8ffb3;
--notify-debug-text: #000000;
--notify-error-bg: #FFD2D2;
--notify-error-text: #D8000C;
--notify-warning-bg: #FEEFB3;
--notify-warning-text: #9F6000;
--table-border: black;
--toc-bg: #eee;
/* Donut chart, one muted color per memory type */
--chart-anon: #4C72B0;
--chart-bounce: #937860;
--chart-cached: #DD8452;
--chart-free: #D6D6D6;
--chart-other: #8C8C8C;
--chart-pagecache: #DD8452;
--chart-pagetables: #8172B3;
--chart-slab: #55A868;
--chart-sub-entry-text: #555555;
--chart-swatch-border: #B0B0B0;
--chart-unevictable: #C44E52;
--chart-used: #4C72B0;
}
body {
margin: 0 auto;
font-family: "Helvetica", "Arial", sans-serif; /* use a sans-serif font to improve page look */
line-height: 1.5; /* increase readability */
padding: 1em;
}
table {
border-collapse: collapse;
line-height: normal; /* reset line-height in all tables */
}
.text--align-right {
text-align: right;
}
.text__superscript {
vertical-align: super;
font-size: 0.83em;
}
.js-text--default-hide {
/* empty - used with JS to hide elements in the default view
*
* OOMDisplay.set_html_defaults() hides all elements by
* adding "js-text--display-none" to classList.
*/
}
.js-text--default-show {
/* empty - used with JS to show elements in the default view
*
* OOMDisplay.set_html_defaults() shows all elements by
* removing "js-text--display-none" from classList.
*/
}
.js-text--display-none {
/* hide elements
*
* The visibility of elements will be toggled with JS.
* OOMAnalyser.show_element_by_id(), OOMAnalyser.hide_element_by_id() and
* OOMAnalyser.show_elements_by_selector(), OOMAnalyser.hide_elements_by_selector() and
* OOMAnalyser.toggle_visibility_by_id() are used to control the
* visibility.
*
* Set js-text--display-none to prevent flickering between loading
* the page and setting default values with
* OOMDisplay.set_html_defaults().
*/
display: none;
}
.table__sub-section--bold {
font-weight: bold;
font-size: medium;
padding: 5px;
}
a {
text-decoration: none;
}
a:hover, a:active {
text-decoration: underline;
}
.a--small {
font-size: small;
font-weight: unset;
padding: unset;
}
.a__footnote {
vertical-align: super;
font-size: 0.83em;
}
.h2--no-newline {
/* Prevent a linebreak after headline to a place a link on the same line */
/* Place such headlines within a div container if the next element can be invisible */
display: inline-block;
}
.js-mem-usage__svg {
display: block;
}
.chart__swatch {
/* keep pale swatches distinguishable from the white background */
stroke: var(--chart-swatch-border);
stroke-width: 1;
}
.chart__sub-entry {
/* subordinate the counters listed below a collecting segment */
fill: var(--chart-sub-entry-text);
}
.chart__segment--anon { stroke: var(--chart-anon); }
.chart__swatch--anon { fill: var(--chart-anon); }
.chart__segment--bounce { stroke: var(--chart-bounce); }
.chart__swatch--bounce { fill: var(--chart-bounce); }
.chart__segment--cached { stroke: var(--chart-cached); }
.chart__swatch--cached { fill: var(--chart-cached); }
.chart__segment--free { stroke: var(--chart-free); }
.chart__swatch--free { fill: var(--chart-free); }
.chart__segment--other { stroke: var(--chart-other); }
.chart__swatch--other { fill: var(--chart-other); }
.chart__segment--pagecache { stroke: var(--chart-pagecache); }
.chart__swatch--pagecache { fill: var(--chart-pagecache); }
.chart__segment--pagetables { stroke: var(--chart-pagetables); }
.chart__swatch--pagetables { fill: var(--chart-pagetables); }
.chart__segment--slab { stroke: var(--chart-slab); }
.chart__swatch--slab { fill: var(--chart-slab); }
.chart__segment--unevictable { stroke: var(--chart-unevictable); }
.chart__swatch--unevictable { fill: var(--chart-unevictable); }
.chart__segment--used { stroke: var(--chart-used); }
.chart__swatch--used { fill: var(--chart-used); }
.js-alloc-failure--show {
/* empty - used to hide/show detailed allocation failure analysis */
}
.js-alloc-failure-below-low-watermark--show {
/* empty - used to hide/show details for failed memory allocations */
}
.js-alloc-failure-no-free-chunks--show {
/* empty - used to hide/show details for failed memory allocations */
}
.js-alloc-failure-unknown-reason--show {
/* empty - used to hide/show details for failed memory allocations */
}
.js-dont-add-human-readable-sizes {
/* empty - used to do not add human readable sizes */
}
/* Tooltip child element to show the same size as the parent element but formatted human-readably */
.js-human-readable-sizes {
position: relative;
cursor: pointer;
text-decoration: underline dotted;
}
/* Show tooltip when the mouse pointer is over the element */
.js-human-readable-sizes:hover .js-human-readable-sizes__tooltip {
visibility: visible;
opacity: 1;
}
/* Tooltip styling and behaviour */
.js-human-readable-sizes__tooltip {
visibility: hidden;
opacity: 0;
background-color: var(--tooltip-bg);
color: var(--tooltip-text);
text-align: center;
border-radius: 4px;
padding: 5px 10px;
position: absolute;
z-index: 1;
bottom: 125%; /* show tooltip over element */
left: 50%;
transform: translateX(-50%);
transition: opacity 0.3s;
white-space: nowrap;
}
/* Add a small triangular arrow to the tooltip pointing downward to indicate the triggering element. */
.js-human-readable-sizes__tooltip::after {
content: '';
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: var(--tooltip-arrow-bg) transparent transparent transparent;
}
.js-kernel-upgrade64--show {
/* empty - used to hide/show details for kernel upgrade to 64-bit */
}
.js-killed-proc-score--show {
/* empty - used to hide/show OOM score of killed process */
}
.js-memory-fragmentation--show {
/* empty - used to hide/show details for memory fragmentation */
}
.js-memory-heavy-fragmentation--show {
/* empty - used to hide/show details for memory fragmentation */
}
.js-memory-no-heavy-fragmentation--show {
/* empty - used to hide/show details for memory fragmentation */
}
.js-memory-shortage-node--hide {
/* empty - used to show the NUMA node with memory shortage */
}
.js-oom-kernel-automatic--show {
/* empty - used to show sections for automatically triggered kernel OOMs */
}
.js-oom-kernel-manual--show {
/* empty - used to show sections for manually triggered kernel OOMs */
}
.js-oom-cgroup-v1--show {
/* empty - used to show sections for automatically triggered cgroup v1 OOMs */
}
.js-oom-cgroup-v2--show {
/* empty - used to show sections for automatically triggered cgroup v2 OOMs */
}
.js-pagesize-guessed--show {
/* empty - used to show if the page size is guessed */
}
.js-pagesize-determined--show {
/* empty - used to show if the page size is determined */
}
.js-pstable_sort_col0 {
/* empty - used to sort process table */
}
.js-pstable_sort_col1 {
/* empty - used to sort process table */
}
.js-pstable_sort_col2 {
/* empty - used to sort process table */
}
.js-pstable_sort_col3 {
/* empty - used to sort process table */
}
.js-pstable_sort_col4 {
/* empty - used to sort process table */
}
.js-pstable_sort_col5 {
/* empty - used to sort process table */
}
.js-pstable_sort_col6 {
/* empty - used to sort process table */
}
.js-pstable_sort_col7 {
/* empty - used to sort process table */
}
.js-pstable_sort_col8 {
/* empty - used to sort process table */
}
.js-pstable_sort_col9 {
/* empty - used to sort process table */
}
.js-system-ram-active--show {
/* empty - used to show if system RAM statistics are available */
}
.js-system-swap-active--show {
/* empty - used to show if the system swap space is activated */
}
.js-system-swap-inactive--show {
/* empty - used to show if the system swap space is not activated */
}
.js-cgroup-v1-swap-active--show {
/* empty - used to show if the cgroup swap space is activated */
}
.js-cgroup-v2-swap-active--show {
/* empty - used to show if the cgroup swap space is activated */
}
.js-cgroup-swap-inactive--show {
/* empty - used to show if the cgroup swap space is not activated */
}
.js-cgroup-swap-unlimited--show {
/* empty - used to show if the cgroup swap space is unlimited */
}
.js-trigger-proc-pid-only--show {
/* empty - used to hide/show only PID of trigger process */
}
.js-trigger-proc-pid-uid--show {
/* empty - used to hide/show PID and UID of trigger process */
}
.result__table {
padding: 10px;
table-layout: fixed;
text-align: left;
width: 100%;
}
.result__table--size-col-1 {
width: 300px;
}
.result__table--border {
padding: 10px;
}
.pstable__table--noborder {
background-color: unset;
border: none;
line-height: normal;
table-layout: fixed;
text-align: right;
}
.pstable__table--noborder thead * {
border: none; /* overwrite the generic th/td settings */
font-weight: bold;
padding-right: unset;
padding-left: unset;
white-space: nowrap;
}
.pstable__table--noborder tbody * {
border: none; /* overwrite the generic th/td settings */
padding-bottom: unset;
padding-top: unset;
padding-left: 5px;
padding-right: 18px;
}
/* Align last both columns to left in the process table */
.pstable__table--noborder td:nth-of-type(9) {
text-align: left;
}
.pstable__table--noborder td:nth-of-type(10) {
text-align: left;
}
/* Highlight the killed process like an error and the trigger process like a warning */
.js-pstable__killedproc--bgcolor {
background-color: var(--notify-error-bg);
}
.js-pstable__triggerproc--bgcolor {
background-color: var(--notify-warning-bg);
}
.pstable__row-numeric--width {
width: 10ch;
}
.pstable__row-pages--width {
width: 16ch;
}
.pstable__row-oom-score-adj--width {
width: 16ch;
}
.pstable__row-notes--width {
width: 20ch;
}
.pstable__row-sort--width {
display: inline-block;
padding-left: unset;
padding-right: unset;
width: 10px;
}
th {
font-size: large;
font-weight: bold;
padding: 5px;
}
th, td {
border: 1px solid var(--table-border);
padding: 5px;
word-wrap: break-word;
}
.js-notify_box__msg--debug {
color: var(--notify-debug-text);
background-color: var(--notify-debug-bg);
}
.js-notify_box__msg--error {
color: var(--notify-error-text);
background-color: var(--notify-error-bg);
}
.js-notify_box__msg--warning {
color: var(--notify-warning-text);
background-color: var(--notify-warning-bg);
}
.license__text {
font-size: small;
}
.notify_box {
width: 100%;
}
.terminal {
font-family: monospace;
overflow: auto;
}
.table-of-contents {
float: right;
width: 40%;
background: var(--toc-bg);
font-size: 0.8em;
padding: 1em 2em;
margin: 0 0 0.5em 0.5em;
}
.table-of-contents ul {
padding: 0;
padding-right: 2em;
padding-left: 1em;
}
.table-of-contents li {
margin: 0 0 0.25em 0;
}
</style>
<script>
function goBack() {
window.history.back();
}
// Add listener after the document has been loaded completely
window.addEventListener('DOMContentLoaded', function() {
let dropArea = document.getElementById('input');
if (dropArea) {
dropArea.addEventListener('drop', file_dragged, false);
dropArea.addEventListener('dragover', function(e) { e.preventDefault(); }, false);
}
// File input change handler
let fileInput = document.querySelector('input[type="file"]');
if (fileInput) {
fileInput.addEventListener('change', function(e) {
read_and_display_file(this.files[0]);
});
}
// Examples select change handler
let examplesSelect = document.getElementById('examples');
if (examplesSelect) {
examplesSelect.addEventListener('change', function(e) {
OOMAnalyser.OOMDisplayInstance.copy_example_to_form();
});
}
// Button click handlers
let analyseButton = document.querySelector('button[title="Analyse the OOM from the input area and show it"]');
if (analyseButton) {
analyseButton.addEventListener('click', function(e) {
OOMAnalyser.OOMDisplayInstance.analyse_and_show();
});
}
let resetButtons = document.querySelectorAll('button[title="Clean the input area"]');
resetButtons.forEach(function(button) {
button.addEventListener('click', function(e) {
OOMAnalyser.OOMDisplayInstance.reset_form();
});
});
// Process table sort column handlers (10 columns)
for (let i = 0; i <= 9; i++) {
let sortLink = document.getElementById('js-pstable_sort_col' + i);
if (sortLink) {
sortLink.addEventListener('click', function(e) {
e.preventDefault();
OOMAnalyser.OOMDisplayInstance.sort_pstable(i);
});
}
}
// Toggle OOM message handler
let oomToggle = document.getElementById('oom_toggle_msg');
if (oomToggle) {
oomToggle.addEventListener('click', function(e) {
e.preventDefault();
OOMAnalyser.OOMDisplayInstance.toggle_oom();
});
}
// Reset form navigation links
let resetLinks = document.querySelectorAll('a[title="Run a new analysis"]');
resetLinks.forEach(function(link) {
link.addEventListener('click', function(e) {
e.preventDefault();
OOMAnalyser.OOMDisplayInstance.reset_form();
});
});
// Toggle section handlers (changelog, installation, license)
let changelogToggle = document.getElementById('changelog_toggle');
if (changelogToggle) {
changelogToggle.addEventListener('click', function(e) {
e.preventDefault();
OOMAnalyser.toggle_visibility_by_id('changelog');
});
}
let installationToggle = document.getElementById('installation_toggle');
if (installationToggle) {
installationToggle.addEventListener('click', function(e) {
e.preventDefault();
OOMAnalyser.toggle_visibility_by_id('installation');
});
}
let licenseToggle = document.getElementById('license_toggle');
if (licenseToggle) {
licenseToggle.addEventListener('click', function(e) {
e.preventDefault();
OOMAnalyser.toggle_visibility_by_id('license');
});
}
// Go back link handler
let goBackLink = document.getElementById('goback_link');
if (goBackLink) {
goBackLink.addEventListener('click', function(e) {
e.preventDefault();
goBack();
});
}
});
// Event handler triggered if a file has been dragged
function file_dragged(event) {
event.preventDefault();
if (!event.dataTransfer || !event.dataTransfer.files || event.dataTransfer.files.length === 0) {
return false;
}
let file = event.dataTransfer.files[0];
read_and_display_file(file);
return true;
}
// Read and display local file
function read_and_display_file(file) {
if (!file) {
return;
}
// Feature detection for FileReader API
if (!window.FileReader) {
alert('Error: Your browser does not support the FileReader API. Please use a modern browser.');
return;
}
// File size validation (limit to 50MB to prevent browser hang)
const MAX_FILE_SIZE = 50 * 1024 * 1024; // 50MB in bytes
if (file.size > MAX_FILE_SIZE) {
alert('Error: File is too large. Maximum supported file size is 50MB.\n\nFile size: ' + (file.size / 1024 / 1024).toFixed(2) + 'MB');
return;
}
let reader = new FileReader();
reader.onload = function(e) {
let textarea_oom = document.getElementById('textarea_oom');
if (textarea_oom) {
textarea_oom.value = reader.result;
}
};
reader.onerror = function(e) {
console.error('Error reading file:', e);
alert('Error: Failed to read file. Please ensure the file is accessible and try again.');
};
reader.readAsText(file);
}
// Report uncaught errors to the user
window.onerror = function (msg, url, lineNo, columnNo, errorObj) {
let notify_box = document.getElementById('notify_box');
if (!notify_box) {
console.error('Error notification box not found in DOM');
return true;
}
notify_box.classList.remove('js-text--display-none');
let notification = document.createElement('div');
notification.classList.add('js-notify_box__msg--error');
// Create structured error display safely using textContent to prevent XSS
let errorTitle = document.createElement('strong');
errorTitle.textContent = 'INTERNAL ERROR:';
notification.appendChild(errorTitle);
notification.appendChild(document.createElement('br'));
let errorMsg = document.createTextNode(`${msg} at ${url}:${lineNo}:${columnNo}`);
notification.appendChild(errorMsg);
notification.appendChild(document.createElement('br'));
if (errorObj && '__args__' in errorObj && errorObj.__args__ !== undefined) {
let details = document.createTextNode(`Details: ${errorObj.__args__}`);
notification.appendChild(details);
notification.appendChild(document.createElement('br'));
}
if (errorObj && 'stack' in errorObj && errorObj.stack !== undefined) {
let stackLabel = document.createTextNode('Stack trace:');
notification.appendChild(stackLabel);
notification.appendChild(document.createElement('br'));
// Split stack by newlines and create text nodes
let stackLines = errorObj.stack.split('\n');
stackLines.forEach(line => {
notification.appendChild(document.createTextNode(line));
notification.appendChild(document.createElement('br'));
});
}
notify_box.appendChild(notification);
// true - don't propagate the event to the default handler
return true;
};
</script>
</head>
<body>
<h1>Analyse and explain Linux OOM output</h1>
<nav class="table-of-contents" id="table_of_contents">
<h2>On this page</h2>
<ul>
</ul>
</nav>
<p>
OOMAnalyser is a web page to analyse and explain the OOM message of a Linux kernel. The analysis is performed
automatically in the browser. You get a summary and a list of (almost) all parameters with their values and a
short explanation. Among them are also 2 diagrams that illustrate the memory usage.
</p>
<p>
OOMAnalyser consists of a web page where the OOM message is copied into the input field. JavaScript code extracts
the data and displays the details. All processing takes place in the browser. No data is transferred to any server.
Therefore, confidential OOM messages can also be analyzed, and the analysis can be performed in environments
without an Internet connection.
</p>
<p>
This project is written in <a href="https://www.python.org" target="_blank" rel="noopener noreferrer">Python</a> and uses
<a href="https://www.transcrypt.org/" target="_blank" rel="noopener noreferrer">Transcrypt</a> to translate Python code into JavaScript.
</p>
<div class="terminal notify_box js-text--default-hide js-text--display-none" id="notify_box"></div>
<div class="js-text--default-show" id="input">
<h2 id="step1">Step 1 - Enter your OOM message</h2>
<textarea autocomplete="off" cols="100" id="textarea_oom"
placeholder="<Paste your OOM here, drag & drop a file or use the file dialog below>"
rows="20" title="OOM input field"></textarea>
<br>
<div>
<input accept=".txt,.log" type="file">
</div>
<br>
<button title="Analyse the OOM from the input area and show it" type="button">Analyse OOM block</button>
<button title="Clean the input area" type="reset">Reset form</button>
<select id="examples" name="examples">
<option value="empty">Select an example:</option>
<option value="RHEL7">Insert RHEL7 example, Kernel 3.10, swap enabled</option>
<option value="Ubuntu_2110">Insert Ubuntu 21.10 example, Kernel 5.13, swap disabled</option>
<option value="ArchLinux">Insert ArchLinux example, Kernel 6.1.1, swap enabled</option>
<option value="Proxmox_cgroup_oom">Insert Proxmox cgroup OOM example, Kernel 5.15.158, swap disabled</option>
</select>
</div>
<div class="js-text--default-hide js-text--display-none" id="analysis">
<h2 id="step2">Step 2 - Results</h2>
<p>
Go back to
<a href="#" title="Run a new analysis">"Step 1 - Enter your OOM message"</a>
to run a new analysis.
</p>
<h3 id="summary">Summary</h3>
<div id="explanation">
<div class="js-text--default-hide js-text--display-none js-oom-cgroup-v1--show js-oom-cgroup-v2--show">
<p>
The cgroup-local OOM killer was automatically triggered because the memory usage inside a control group
<span class="js-text--default-hide js-text--display-none js-oom-cgroup-v1--show">v1</span>
<span class="js-text--default-hide js-text--display-none js-oom-cgroup-v2--show">v2</span>
exceeded its configured limit. Unlike a global OOM event, the system itself still had
free memory available. The cgroup-local OOM killer evaluates the tasks within that cgroup, assigns
scores, and terminates the process with the highest score in order to bring the group's memory
consumption back within limits.
</p>
</div>
<div class="js-text--default-hide js-text--display-none js-oom-kernel-automatic--show">
<p>
The global OOM killer was automatically triggered to free memory because the system couldn't
satisfy the memory request.
It evaluates all running processes, assigns each a score based on their memory footprint and
importance, and terminates the process with the highest score in order to free memory.
</p>
</div>
<div class="js-text--default-hide js-text--display-none js-oom-kernel-manual--show">
<p>
The global OOM killer was manually triggered (e.g., with <code>echo f > /proc/sysrq-trigger</code>)
by a user with root privileges. Even though there was no immediate memory shortage, it still
evaluated all processes, calculated their scores, and terminated the process with the highest score.
</p>
</div>
<div class="js-text--default-hide js-text--display-none js-system-swap-active--show js-oom-kernel-manual--show">
<p>
The system has <span class="system_total_ram_kb"></span> physical memory and
<span class="system_swap_total_kb"></span> system swap space. That's <span class="system_total_ramswap_kb"></span>
total.
<span class="js-text--default-hide js-text--display-none js-system-ram-usage--show"><span class="system_total_used_percent"></span>
(<span class="system_total_ram_used_kb"></span> out of <span class="system_total_ram_kb"></span>)
physical memory is in use.</span>
<span class="system_swap_used_percent"></span>
(<span class="system_swap_used_kb"></span> out of <span class="system_swap_total_kb"></span>) system swap space is in use.
</p>
</div>
<div class="js-text--default-hide js-text--display-none js-cgroup-v1-swap-active--show js-cgroup-v2-swap-active--show">
<p>
Swap space is enabled for this cgroup.
</p>
</div>
<div class="js-text--default-hide js-text--display-none js-cgroup-swap-inactive--show">
<p>
Swap space usage is disabled for this cgroup.
</p>
</div>
<div class="js-text--default-hide js-text--display-none js-cgroup-swap-unlimited--show">
<p>
Swap space usage is unlimited for this cgroup.
</p>
</div>
<div class="js-text--default-hide js-text--display-none js-cgroup-v1-swap-active--show">
<p>
Combined memory and swap usage:
<span class="cgroup_memory_swap_usage_kb"></span> out of
<span class="cgroup_memory_swap_limit_kb"></span> limit.
</p>
</div>
<div class="js-text--default-hide js-text--display-none js-cgroup-v2-swap-active--show">
<p>
Memory usage: <span class="cgroup_memory_usage_kb"></span> out of
<span class="cgroup_memory_limit_kb"></span> RAM limit. Swap usage:
<span class="cgroup_swap_usage_kb"></span> out of
<span class="cgroup_swap_limit_kb"></span> swap limit.
</p>
</div>
<div class="js-text--default-hide js-text--display-none js-system-swap-inactive--show">
<p>
The system has <span class="system_total_ram_kb"></span> physical memory and no system swap space.
<span class="js-text--default-hide js-text--display-none js-system-ram-usage--show"><span class="system_total_used_percent"></span>
(<span class="system_total_ram_used_kb"></span> out of <span class="system_total_ram_kb"></span>)
physical memory is in use.</span>
</p>
</div>
<div class="js-text--default-hide js-text--display-none js-oom-kernel-automatic--show">
<p>
The process "<span class="trigger_proc_name"></span>"
<span class="js-text--default-show js-trigger-proc-pid-only--show">
(PID <span class="trigger_proc_pid"></span>)
</span>
<span class="js-text--default-hide js-text--display-none js-trigger-proc-pid-uid--show">
(PID <span class="trigger_proc_pid"></span>,
UID <span class="trigger_proc_uid"></span>)
</span>
requested a memory chunk of order <span class="trigger_proc_order"></span> from the
"<span class="trigger_proc_mem_zone"></span>" memory zone.
This is 2<span class="text__superscript">order</span> pages ==
2<span class="trigger_proc_order text__superscript"></span> pages ==
<span class="js-dont-add-human-readable-sizes trigger_proc_requested_memory_pages"></span>
a <span class="js-dont-add-human-readable-sizes page_size_kb"></span> ==
<span class="js-dont-add-human-readable-sizes trigger_proc_requested_memory_kb"></span> memory.
</p>
</div>
<div class="js-text--default-hide js-text--display-none js-alloc-failure--show">
<p>
<span class="js-text--default-hide js-text--display-none js-alloc-failure-below-low-watermark--show">
The request failed because the free memory would be below the memory low watermark
after its completion.
</span>
<span class="js-text--default-hide js-text--display-none js-alloc-failure-no-free-chunks--show">
If this requirement was satisfied, the free memory would still be above the low memory watermark.
The request failed because there is no free chunk in the current or higher order.
</span>
<span class="js-text--default-hide js-text--display-none js-alloc-failure-unknown-reason--show">
The request failed, but the reason is unknown.
</span>
This memory shortage triggers the OOM process.
</p>
</div>
<p>
The process "<span class="killed_proc_name"></span>"
(PID <span class="killed_proc_pid"></span>)
<span class="js-text--default-hide js-text--display-none js-killed-proc-score--show">
with an OOM score of <span class="killed_proc_score"></span>
</span>
has been terminated. It uses <span class="killed_proc_rss_percent"></span>
<span class="killed_proc_total_rss_kb"></span> of the resident memory.
</p>
<div class="js-text--default-hide js-text--display-none js-memory-fragmentation--show">
<p>
Dynamic memory allocation is used by both the kernel and all applications. This leads to memory
fragmentation and is a common behavior.
<span class="js-text--default-hide js-text--display-none js-memory-heavy-fragmentation--show">
The system memory is heavily fragmented, because all chunks with an order ≥
<span class="kconfig.PAGE_ALLOC_COSTLY_ORDER"></span> are in use. Allocation of larger contiguous
memory areas will fail.
<br>
The amount of fragmentation depends on the software run on the system, and the best fix would be
to improve the software that causes heavy fragmentation. If that's not possible, compacting the
memory (memory defragmentation) can be triggered more often.
</span>
<span class="js-text--default-hide js-text--display-none js-memory-no-heavy-fragmentation--show">
The system memory is not heavily fragmented, because chunks with an order ≥
<span class="kconfig.PAGE_ALLOC_COSTLY_ORDER"></span> are freely available.
</span>
</p>
</div>
</div>
<h3 id="corrective_actions">Corrective Actions</h3>
<p>
At the top of this list are the measures that have the greatest impact on preventing OOMs.
</p>
<ol>
<li>
Use an appropriate memory setup, i.e., configure your server with enough memory to run your workload
or configure your application to use only the available memory.
</li>
<li>
Improve software that causes memory fragmentation or ask the software vendor to improve it.
</li>
<li class="js-text--default-hide js-text--display-none js-kernel-upgrade64--show">
The system has a 32-bit kernel. Consider upgrading to a 64-bit kernel
as the memory zone setup has been improved.
</li>
<li>
Trigger memory compaction manually to provide more contiguous blocks of free memory.
Write <code>1</code> to <code>/proc/sys/vm/compact_memory</code>.
</li>
<li>
Try different memory tunables to run memory compaction more aggressively. This may postpone the OOM
event, but of course will not prevent it.
<ol>
<li>
increase <code>/proc/sys/vm/watermark_scale_factor</code>
</li>
<li>
increase <code>/proc/sys/vm/watermark_boost_factor</code>
</li>
<li>
enable a more aggressive approach to memory reclaim by writing <code>3</code> to
<code>/proc/sys/vm/zone_reclaim_mode</code>
</li>
<li>
decrease the value <code>/proc/sys/vm/extfrag_threshold</code> to start memory compaction earlier
</li>
</ol>
More aggressive memory defragmentation can cause latency spikes during its execution.
</li>
</ol>
<h3 id="details">Details of analysis</h3>
<p>
The result of the analysis is displayed in three columns. The first column is used to name the property
including the original OOM identifier in brackets. The extracted information is displayed in the second column.
The last column contains further details and additional information.
</p>
<table id="result_table" class="result__table">
<colgroup>
<col class="result__table--size-col-1">
<col>
<col>
</colgroup>
<!-- Trigger process -->
<tbody id="tbody_trigger_process" class="js-text--default-hide js-text--display-none js-oom-kernel-automatic--show js-oom-kernel-manual--show">
<tr>
<th colspan="3" scope="row">Trigger Process</th>
</tr>
<tr class="js-text--default-hide js-text--display-none">
<td></td>
<td class="text--align-right">
<span class="trigger_proc_name"></span>
<span class="js-text--default-show js-trigger-proc-pid-only--show">
(PID <span class="trigger_proc_pid"></span>)
</span>
<span class="js-text--default-hide js-text--display-none js-trigger-proc-pid-uid--show">
(PID <span class="trigger_proc_pid"></span>,
UID <span class="trigger_proc_uid"></span>)
</span>
</td>
<td>This process requested memory and triggered thereby the OOM situation.</td>
</tr>
<tr class="js-text--default-hide">
<td>Memory allocation flags <br> (gfp_mask)</td>
<td class="text--align-right"><span class="trigger_proc_gfp_mask"></span></td>
<td>These flags are also called GFP (get free pages) flags. They control the kernel-internal memory
allocation.<br>
Some OOM variants include the individual flags in addition to the hexadecimal representation. The flags
are calculated if they are not specified.
</td>
</tr>
<tr class="js-text--default-hide js-text--display-none">
<td>Node mask to show on which CPU Cores this process can run <br> (nodemask)</td>
<td class="text--align-right"><span class="trigger_proc_nodemask"></span></td>
<td>Bit mask indicating the cores on which the process can run.</td>
</tr>
<tr class="js-text--default-hide js-text--display-none js-oom-kernel-automatic--show">
<td>Requested memory: order</td>
<td class="text--align-right">
<span class="trigger_proc_order"></span>
</td>
<td>The kernel specifies the requested number of pages as an exponent of a power of two.</td>
</tr>
<tr class="js-text--default-hide js-text--display-none">
<td>Requested memory: number of pages</td>
<td class="text--align-right">
<span class="js-dont-add-human-readable-sizes trigger_proc_requested_memory_pages"></span>
(2<span class="trigger_proc_order text__superscript"></span> pages) a
<span class="page_size_kb"></span> per page
</td>
<td>Requested memory in number of pages.</td>
</tr>
<tr class="js-text--default-hide js-text--display-none">
<td>Requested memory: size</td>
<td class="text--align-right"><span class="trigger_proc_requested_memory_kb"></span></td>
<td>Requested memory in kBytes.</td>
</tr>
<tr class="js-text--default-hide js-text--display-none">
<td>Requested memory: zone</td>
<td class="text--align-right"><span class="trigger_proc_mem_zone"></span></td>
<td>Memory zone from which the requested storage chunk should come.</td>
</tr>
<tr class="js-text--default-hide js-text--display-none js-memory-shortage-node--hide">
<td>Requested memory: node</td>
<td class="text--align-right"><span class="trigger_proc_numa_node"></span></td>
<td>
First NUMA node with memory shortage watermark <code>free < min </code> in memory watermark
information.
<br>
Assumption that this is the node where the OOM was triggered.
</td>
</tr>
<tr class="js-text--default-hide js-text--display-none js-memory-shortage-node--hide">
<td>Adjust oom-killer score <br> (oom_score_adj)</td>
<td class="text--align-right"><span class="trigger_proc_oomscore"></span></td>