cat /var/log/messages | grep memory 查看内存溢出 OOM
[root@test /]# cat /var/log/messages | grep memory
Nov 29 18:14:35 test kernel: [<ffffffffaddcdaaa>] out_of_memory+0x31a/0x500
Nov 29 18:14:36 test kernel: Out of memory: Kill process 9339 (dmserver) score 548 or sacrifice child
Nov 29 20:17:43 test kernel: [<ffffffffaddcdaaa>] out_of_memory+0x31a/0x500
Nov 29 20:17:44 test kernel: Out of memory: Kill process 16137 (python3) score 784 or sacrifice child
[root@test /]#
dmesg
[610413.424499] Out of memory: Kill process 27838 (dmserver) score 860 or sacrifice child
[610413.428022] Killed process 27838 (dmserver), UID 12345, total-vm:25032388kB, anon-rss:6864668kB, file-rss:0kB, shmem-rss:0kB
[625743.320600] bash invoked oom-killer: gfp_mask=0x200da, order=0, oom_score_adj=0
[625743.320605] bash cpuset=/ mems_allowed=0
[625743.320609] CPU: 0 PID: 23065 Comm: bash Tainted: G OE ------------ 3.10.0-1160.102.1.el7.x86_64 #1
[625743.320610] Hardware name: Alibaba Cloud Alibaba Cloud ECS, BIOS 449e491 04/01/2014
[625743.320612] Call Trace:
[625743.320621] [<ffffffff997b1bec>] dump_stack+0x19/0x1f
[625743.320625] [<ffffffff997acb4f>] dump_header+0x90/0x22d
[625743.320629] [<ffffffff9910d4f2>] ? ktime_get_ts64+0x52/0xf0
[625743.320635] [<ffffffff991cd3a5>] oom_kill_process+0x2d5/0x4a0
[625743.320638] [<ffffffff991ccd6d>] ? oom_unkillable_task+0xcd/0x120
[625743.320641] [<ffffffff991cdaaa>] out_of_memory+0x31a/0x500
[625743.320643] [<ffffffff991d48b4>] __alloc_pages_nodemask+0xae4/0xbf0
[625743.320650] [<ffffffff992293c9>] alloc_pages_vma+0xa9/0x210
[625743.320654] [<ffffffff991fb3e4>] wp_page_copy.isra.73+0xb4/0x5d0
[625743.320672] [<ffffffffc043ba11>] ? ext4_filemap_fault+0x41/0x50 [ext4]
[625743.320675] [<ffffffff991fdb6b>] do_wp_page+0xfb/0x730
[625743.320677] [<ffffffff991c90fb>] ? unlock_page+0x2b/0x40
[625743.320680] [<ffffffff991fa869>] ? do_read_fault.isra.63+0x139/0x1b0
[625743.320683] [<ffffffff9920228a>] handle_mm_fault+0xb3a/0x1190
[625743.320690] [<ffffffff997bf7d3>] __do_page_fault+0x213/0x510
[625743.320704] [<ffffffff997bfbb6>] trace_do_page_fault+0x56/0x150
[625743.320706] [<ffffffff997bf112>] do_async_page_fault+0x22/0x100
[625743.320709] [<ffffffff997bb7e8>] async_page_fault+0x28/0x30
[625743.320710] Mem-Info:
[625743.320715] active_anon:1886155 inactive_anon:110 isolated_anon:0
active_file:1931 inactive_file:3372 isolated_file:37
unevictable:0 dirty:0 writeback:0 unstable:0
slab_reclaimable:9192 slab_unreclaimable:13254
mapped:812 shmem:260 pagetables:10192 bounce:0
free:25755 free_pcp:0 free_cma:0
[625743.320720] Node 0 DMA free:15908kB min:132kB low:164kB high:196kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:15992kB managed:15908kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes
[625743.320726] lowmem_reserve[]: 0 2830 7802 7802