Linux oom-killer 杀死了 Ubuntu Server(托管在 Amazon EC2)上的 Jboss

Linux oom-killer 杀死了 Ubuntu Server(托管在 Amazon EC2)上的 Jboss

我们在 Ubuntu Server 上使用 oom-killer 和 JBoss 时遇到了一些问题。我想知道是否有办法通过将额外的参数传递给 JVM 或 JBoss 来避免这种情况?

另一方面,你们知道如何在不改变实例类型的情况下向 EC2 实例添加更多 RAM 吗(实际上它是一个只有 1.7 GB 的中型实例)?

我正在发布我从命令 dmesg 获得的消息。这些消息说明了什么?

谢谢你!

[18272.090504] java invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0
[18272.090510] java cpuset=/ mems_allowed=0
[18272.090514] Pid: 1056, comm: java Not tainted 2.6.32-308-ec2 #16-Ubuntu
[18272.090516] Call Trace:
[18272.090526]  [<c0199538>] oom_kill_process+0xb8/0x1e0
[18272.090530]  [<c01996b1>] __out_of_memory+0x51/0xa0
[18272.090533]  [<c0199752>] out_of_memory+0x52/0xa0
[18272.090536]  [<c019be67>] __alloc_pages_slowpath+0x407/0x4a0
[18272.090540]  [<c019c04d>] __alloc_pages_nodemask+0x14d/0x160
[18272.090544]  [<c019e792>] __do_page_cache_readahead+0xe2/0x200
[18272.090547]  [<c019e8d1>] ra_submit+0x21/0x30
[18272.090550]  [<c01979e8>] filemap_fault+0x3c8/0x3f0
[18272.090554]  [<c01af467>] __do_fault+0x47/0x630
[18272.090557]  [<c01b2b7f>] handle_mm_fault+0x1cf/0x5b0
[18272.090563]  [<c0155d2f>] ? ktime_get_ts+0xdf/0x110
[18272.090570]  [<c05370f9>] do_page_fault+0x119/0x340
[18272.090573]  [<c0536fe0>] ? do_page_fault+0x0/0x340
[18272.090576]  [<c0535525>] error_code+0x3d/0x44
[18272.090578] Mem-Info:
[18272.090580] DMA per-cpu:
[18272.090582] CPU    0: hi:    0, btch:   1 usd:   0
[18272.090584] CPU    1: hi:    0, btch:   1 usd:   0
[18272.090585] Normal per-cpu:
[18272.090587] CPU    0: hi:  155, btch:  38 usd: 129
[18272.090589] CPU    1: hi:  155, btch:  38 usd: 143
[18272.090590] HighMem per-cpu:
[18272.090592] CPU    0: hi:  155, btch:  38 usd: 140
[18272.090594] CPU    1: hi:  155, btch:  38 usd: 113
[18272.090598] active_anon:208477 inactive_anon:208614 isolated_anon:32
[18272.090599]  active_file:187 inactive_file:147 isolated_file:0
[18272.090600]  unevictable:0 dirty:3 writeback:23 unstable:0
[18272.090601]  free:10840 slab_reclaimable:1277 slab_unreclaimable:1983
[18272.090602]  mapped:134 shmem:3 pagetables:0 bounce:0
[18272.090622] DMA free:6908kB min:76kB low:92kB high:112kB active_anon:508kB inactive_anon:712kB active_file:4kB inactive_file:16kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:16256kB mlocked:0kB dirty:0kB writeback:0kB mapped:20kB shmem:0kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:5 all_unreclaimable? yes
[18272.090626] lowmem_reserve[]: 0 696 1710 1710
[18272.090633] Normal free:35332kB min:3336kB low:4168kB high:5004kB active_anon:314428kB inactive_anon:314524kB active_file:732kB inactive_file:472kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:713224kB mlocked:0kB dirty:12kB writeback:92kB mapped:520kB shmem:4kB slab_reclaimable:5108kB slab_unreclaimable:7932kB kernel_stack:2456kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:1957 all_unreclaimable? yes
[18272.090638] lowmem_reserve[]: 0 0 8111 8111
[18272.090645] HighMem free:1120kB min:512kB low:1724kB high:2940kB active_anon:518972kB inactive_anon:519220kB active_file:12kB inactive_file:100kB unevictable:0kB isolated(anon):128kB isolated(file):0kB present:1038292kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB shmem:8kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:334 all_unreclaimable? no
[18272.090649] lowmem_reserve[]: 0 0 0 0
[18272.090652] DMA: 1*4kB 3*8kB 0*16kB 1*32kB 1*64kB 1*128kB 0*256kB 1*512kB 2*1024kB 0*2048kB 1*4096kB = 6908kB
[18272.090684] Normal: 701*4kB 796*8kB 451*16kB 154*32kB 63*64kB 32*128kB 5*256kB 1*512kB 0*1024kB 0*2048kB 1*4096kB = 35332kB
[18272.090706] HighMem: 152*4kB 0*8kB 0*16kB 6*32kB 1*64kB 0*128kB 1*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 1120kB
[18272.090716] 37223 total pagecache pages
[18272.090718] 36842 pages in swap cache
[18272.090720] Swap cache stats: add 5537986, delete 5501144, find 1747319/2163743
[18272.090721] Free swap  = 0kB
[18272.090722] Total swap = 917496kB
[18272.098867] 447488 pages RAM
[18272.098875] 263682 pages HighMem
[18272.098877] 10458 pages reserved
[18272.098878] 2162 pages shared
[18272.098879] 424736 pages non-shared
[18272.098883] Out of memory: kill process 26909 (run.sh) score 11830922 or a child
[18272.098898] Killed process 26939 (java)

答案1

Linux 本身内存不足并终止 Java

您的可能解决方案是让应用程序使用更少的内存(您可以在 Java VM 上设置内存限制),或者增加内存(EC2 具有高 RAM 实例)。

相关内容