Linux超出内存的杀手是否超过5 GB免费?

时间:2017-02-10 07:11:54

标签: linux memory-management out-of-memory ubuntu-16.04

在我最近安装的ubuntu 16.04服务器上可重复使用OOM杀手,尽管有5 GB内存可用。

我知道记忆可以是免费的但是支离破碎,避免分配必要的大块,但这似乎是不切实际的。

在发生之前和之后,我用free -m多次监视系统状态,available内存量从未降到4 GB以下。

dmsg摘录是否解释了为什么要调用OOM杀手?

[297330.640964] apache2ctl invoked oom-killer: gfp_mask=0x26000c0, order=2, oom_score_adj=0
[297330.640965] apache2ctl cpuset=/ mems_allowed=0
[297330.640968] CPU: 3 PID: 18067 Comm: apache2ctl Tainted: G           OE   4.4.0-62-generic #83-Ubuntu
[297330.640969] Hardware name: XXXXXXXXXXXXXXX, BIOS V4.6.5.4 R1.34.0 for XXXXXXXX 01/08/2015
[297330.640970]  0000000000000286 00000000cd644d3f ffff88010053baf0 ffffffff813f7c63
[297330.640972]  ffff88010053bcc8 ffff8800a8a52a00 ffff88010053bb60 ffffffff8120ad4e
[297330.640973]  0000000000000015 0000000000000000 ffff8800d43bd9c0 ffff88006c108000
[297330.640974] Call Trace:
[297330.640977]  [<ffffffff813f7c63>] dump_stack+0x63/0x90
[297330.640979]  [<ffffffff8120ad4e>] dump_header+0x5a/0x1c5
[297330.640981]  [<ffffffff81390c14>] ? apparmor_capable+0xc4/0x1b0
[297330.640983]  [<ffffffff811926c2>] oom_kill_process+0x202/0x3c0
[297330.640984]  [<ffffffff81192ae9>] out_of_memory+0x219/0x460
[297330.640986]  [<ffffffff81198a5d>] __alloc_pages_slowpath.constprop.88+0x8fd/0xa70
[297330.640988]  [<ffffffff81198e56>] __alloc_pages_nodemask+0x286/0x2a0
[297330.640989]  [<ffffffff81198f0b>] alloc_kmem_pages_node+0x4b/0xc0
[297330.640991]  [<ffffffff8107ea5e>] copy_process+0x1be/0x1b70
[297330.640992]  [<ffffffff8139225c>] ? apparmor_file_alloc_security+0x5c/0x220
[297330.640994]  [<ffffffff811ed04a>] ? kmem_cache_alloc+0x1ca/0x1f0
[297330.640996]  [<ffffffff81348263>] ? security_file_alloc+0x33/0x50
[297330.640998]  [<ffffffff810805a0>] _do_fork+0x80/0x360
[297330.640999]  [<ffffffff81080929>] SyS_clone+0x19/0x20
[297330.641001]  [<ffffffff818385f2>] entry_SYSCALL_64_fastpath+0x16/0x71
[297330.641002] Mem-Info:
[297330.641004] active_anon:103121 inactive_anon:103637 isolated_anon:0
                 active_file:687455 inactive_file:660711 isolated_file:0
                 unevictable:4 dirty:19091 writeback:0 unstable:0
                 slab_reclaimable:83617 slab_unreclaimable:11335
                 mapped:312616 shmem:7280 pagetables:5247 bounce:0
                 free:58173 free_pcp:0 free_cma:0
[297330.641006] Node 0 DMA free:15900kB 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:15984kB managed:15900kB 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
[297330.641009] lowmem_reserve[]: 0 3359 7812 7812 7812
[297330.641011] Node 0 DMA32 free:107500kB min:29004kB low:36252kB high:43504kB active_anon:177316kB inactive_anon:177216kB active_file:1291784kB inactive_file:1184904kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:3561040kB managed:3480420kB mlocked:0kB dirty:12048kB writeback:0kB mapped:465292kB shmem:12724kB slab_reclaimable:98948kB slab_unreclaimable:16312kB kernel_stack:2224kB pagetables:9092kB unstable:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
[297330.641014] lowmem_reserve[]: 0 0 4452 4452 4452
[297330.641015] Node 0 Normal free:109292kB min:38444kB low:48052kB high:57664kB active_anon:235168kB inactive_anon:237332kB active_file:1458036kB inactive_file:1457940kB unevictable:16kB isolated(anon):0kB isolated(file):0kB present:4691968kB managed:4559596kB mlocked:16kB dirty:64316kB writeback:0kB mapped:785172kB shmem:16396kB slab_reclaimable:235520kB slab_unreclaimable:29028kB kernel_stack:3696kB pagetables:11896kB unstable:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
[297330.641018] lowmem_reserve[]: 0 0 0 0 0
[297330.641020] Node 0 DMA: 1*4kB (U) 1*8kB (U) 1*16kB (U) 0*32kB 2*64kB (U) 1*128kB (U) 1*256kB (U) 0*512kB 1*1024kB (U) 1*2048kB (M) 3*4096kB (M) = 15900kB
[297330.641026] Node 0 DMA32: 18992*4kB (UME) 3972*8kB (UME) 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 107744kB
[297330.641030] Node 0 Normal: 26464*4kB (UMEH) 269*8kB (UMEH) 9*16kB (H) 13*32kB (H) 7*64kB (H) 3*128kB (H) 1*256kB (H) 0*512kB 0*1024kB 0*2048kB 0*4096kB = 109656kB
[297330.641036] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=1048576kB
[297330.641037] Node 0 hugepages_total=0 hugepages_free=0 hugepages_surp=0 hugepages_size=2048kB
[297330.641038] 1365108 total pagecache pages
[297330.641038] 9533 pages in swap cache
[297330.641039] Swap cache stats: add 1933140, delete 1923607, find 5787193/6186346
[297330.641040] Free swap  = 7962052kB
[297330.641040] Total swap = 8267772kB
[297330.641041] 2067248 pages RAM
[297330.641042] 0 pages HighMem/MovableOnly
[297330.641042] 53269 pages reserved
[297330.641043] 0 pages cma reserved
[297330.641043] 0 pages hwpoisoned
[297330.641044] [ pid ]   uid  tgid total_vm      rss nr_ptes nr_pmds swapents oom_score_adj name
[297330.641047] [  234]     0   234    10985     2376      23       3       63             0 systemd-journal
[297330.641049] [  328]     0   328    11245      568      24       3      154         -1000 systemd-udevd
[297330.641050] [  940]     0   940     1100       26       8       3       44             0 acpid
...
[297330.641125] Out of memory: Kill process 17688 (java) score 16 or sacrifice child
[297330.642429] Killed process 17688 (java) total-vm:3711380kB, anon-rss:255132kB, file-rss:16380kB

0 个答案:

没有答案