Linux 下OOM(Out Of Memory)

       在ARM开发板上调试应用程序,出现了如下打印信息,经过查资料得知出现了OOM(Out Of Memory),OOM是Linux内核的一种自我保护机制,当系统中内存出现不足时,Linux内核会终止系统中占用内存最多的进程,同时记录下终止的进程并打印终止进程信息。

       具体打印信息如下:

ts: 3 is opend!

[ 1216.720000] upnp_mediaserve invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0
[ 1216.740000] [<c0035d3c>] (unwind_backtrace+0x0/0xe0) from [<c0078f34>] (dump_header.clone.13+0x74/0x1a4)
[ 1216.770000] [<c0078f34>] (dump_header.clone.13+0x74/0x1a4) from [<c00791e8>] (oom_kill_process.clone.16+0x38/0x268)
[ 1216.800000] [<c00791e8>] (oom_kill_process.clone.16+0x38/0x268) from [<c0079814>] (out_of_memory+0x28c/0x340)
[ 1216.820000] [<c0079814>] (out_of_memory+0x28c/0x340) from [<c007ca54>] (__alloc_pages_nodemask+0x4a8/0x61c)
[ 1216.840000] [<c007ca54>] (__alloc_pages_nodemask+0x4a8/0x61c) from [<c00784a0>] (filemap_fault+0x308/0x42c)
[ 1216.870000] [<c00784a0>] (filemap_fault+0x308/0x42c) from [<c008b6a8>] (__do_fault+0x50/0x3f0)
[ 1216.890000] [<c008b6a8>] (__do_fault+0x50/0x3f0) from [<c008de98>] (handle_pte_fault+0x238/0xb74)
[ 1216.910000] [<c008de98>] (handle_pte_fault+0x238/0xb74) from [<c008e898>] (handle_mm_fault+0xc4/0xd4)
[ 1216.930000] [<c008e898>] (handle_mm_fault+0xc4/0xd4) from [<c0036ba4>] (do_page_fault+0xdc/0x1c8)
[ 1216.960000] [<c0036ba4>] (do_page_fault+0xdc/0x1c8) from [<c002b30c>] (do_PrefetchAbort+0x34/0x98)
[ 1216.980000] [<c002b30c>] (do_PrefetchAbort+0x34/0x98) from [<c0030c80>] (ret_from_exception+0x0/0x10)
[ 1217.010000] Exception stack(0xc6505fb0 to 0xc6505ff8)
[ 1217.020000] 5fa0:                                     00000eb0 00000000 461ad4f4 00000002
[ 1217.040000] 5fc0: 4896c8e8 00027958 00027958 00000eaf 10624dd3 0003f1a8 0003f160 00046ec0
[ 1217.070000] 5fe0: 00000000 461acdc0 0001584c 0001584c 00000010 ffffffff
[ 1217.090000] Mem-info:
[ 1217.090000] Normal per-cpu:
[ 1217.100000] CPU    0: hi:   42, btch:   7 usd:  39
[ 1217.120000] active_anon:26124 inactive_anon:0 isolated_anon:0
[ 1217.120000]  active_file:12 inactive_file:96 isolated_file:32
[ 1217.120000]  unevictable:0 dirty:0 writeback:0 unstable:0
[ 1217.120000]  free:358 slab_reclaimable:108 slab_unreclaimable:375
[ 1217.120000]  mapped:13 shmem:0 pagetables:90 bounce:0
[ 1217.170000] Normal free:1432kB min:1440kB low:1800kB high:2160kB active_anon:104496kB inactive_anon:0kB active_file:48kB inactive_file:384kB unevictable:0kB isolated(anon):0kB isolated(file):128kB present:130048kB mlocked:0kB dirty:0kB writeback:0kB mapped:52kB shmem:0kB slab_reclaimable:432kB slab_unreclaimable:1500kB kernel_stack:296kB pagetables:360kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:409 all_unreclaimable? yes
[ 1217.230000] lowmem_reserve[]: 0 0
[ 1217.240000] Normal: 34*4kB 70*8kB 44*16kB 1*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 1432kB
[ 1217.270000] 137 total pagecache pages
[ 1217.310000] 32768 pages of RAM
[ 1217.320000] 457 free pages
[ 1217.340000] 1480 reserved pages
[ 1217.340000] 483 slab pages
[ 1217.350000] 178 pages shared
[ 1217.360000] 0 pages swap cached
[ 1217.380000] [ pid ]   uid  tgid total_vm      rss cpu oom_adj oom_score_adj name
[ 1217.400000] [  414]     0   414      913       37   0       0             0 telnetd
[ 1217.420000] [  422]     0   422      824       29   0       0             0 sh
[ 1217.440000] [  431]     0   431    53739    26028   0       0             0 upnp_mediaserve
[ 1217.470000] [  446]     0   446      824       28   0       0             0 sh
[ 1217.490000] [  449]     0   449     1085       28   0       0             0 top
[ 1217.510000] Out of memory: Kill process 431 (upnp_mediaserve) score 804 or sacrifice child
[ 1217.530000] Killed process 431 (upnp_mediaserve) total-vm:214956kB, anon-rss:104060kB, file-rss:52kB

你可能感兴趣的:(c,linux,exception,kill,File,linux内核)