Linux · 2015-12-10

Linux内存问题导致OOM-Killer

OOM-Killer的详细信息以及oracle非常棒的文章,介绍了为什么进程会被kill掉以及如何配置OOM-Killer

Call Trace:
 [] out_of_memory+0x8b/0x203
 [] __alloc_pages+0x27f/0x308
 [] __do_page_cache_readahead+0xc8/0x1af
 [] filemap_nopage+0x14c/0x360
 [] __handle_mm_fault+0x444/0x144f
 [] monotonic_clock+0x35/0x7b
 [] _spin_lock_irqsave+0x9/0x14
 [] lock_timer_base+0x1b/0x3c
 [] do_page_fault+0xf72/0x131b
 [] schedule_timeout+0x92/0xad
 [] process_timeout+0x0/0x5
 [] _write_lock_irqsave+0x9/0x1c
 [] sys_epoll_wait+0x3ff/0x44d
 [] error_exit+0x0/0x6e

DMA per-cpu:
cpu 0 hot: high 0, batch 1 used:0
cpu 0 cold: high 0, batch 1 used:0
cpu 1 hot: high 0, batch 1 used:0
cpu 1 cold: high 0, batch 1 used:0
cpu 2 hot: high 0, batch 1 used:0
cpu 2 cold: high 0, batch 1 used:0
cpu 3 hot: high 0, batch 1 used:0
cpu 3 cold: high 0, batch 1 used:0
DMA32 per-cpu:
cpu 0 hot: high 186, batch 31 used:157
cpu 0 cold: high 62, batch 15 used:15
cpu 1 hot: high 186, batch 31 used:88
cpu 1 cold: high 62, batch 15 used:49
cpu 2 hot: high 186, batch 31 used:0
cpu 2 cold: high 62, batch 15 used:48
cpu 3 hot: high 186, batch 31 used:25
cpu 3 cold: high 62, batch 15 used:16
Normal per-cpu: empty
HighMem per-cpu: empty
Free pages:       10116kB (0kB HighMem)
Active:524224 inactive:463953 dirty:0 writeback:0 unstable:0 free:2529 slab:7908 mapped-file:1159 mapped-anon:992249 pagetables:13980
DMA free:2220kB min:16kB low:20kB high:24kB active:0kB inactive:0kB present:9052kB pages_scanned:0 all_unreclaimable? yes
lowmem_reserve[]: 0 4024 4024 4024
DMA32 free:7896kB min:8108kB low:10132kB high:12160kB active:2096896kB inactive:1855812kB present:4120800kB pages_scanned:4837103621 all_unreclaimable? yes
lowmem_reserve[]: 0 0 0 0
Normal free:0kB min:0kB low:0kB high:0kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0
HighMem free:0kB min:128kB low:128kB high:128kB active:0kB inactive:0kB present:0kB pages_scanned:0 all_unreclaimable? no
lowmem_reserve[]: 0 0 0 0
DMA: 1*4kB 1*8kB 2*16kB 2*32kB 1*64kB 2*128kB 1*256kB 1*512kB 1*1024kB 0*2048kB 0*4096kB = 2220kB
DMA32: 0*4kB 1*8kB 1*16kB 0*32kB 1*64kB 1*128kB 2*256kB 0*512kB 1*1024kB 1*2048kB 1*4096kB = 7896kB
Normal: empty
HighMem: empty
3227 pagecache pages
Swap cache: add 167606, delete 165590, find 26755/33127, race 0+0
Free swap  = 0kB
Total swap = 262136kB
php-cgi invoked oom-killer: gfp_mask=0x280d2, order=0, oomkilladj=0
#/etc/sysctl.conf
vm.overcommit_memory = 2
vm.overcommit_ratio = 80