Android 低記憶體導致monkey killed分析指南

來源:互聯網
上載者:User

標籤:

現象描述:monkey --pkg-blacklist-file storage/sdcard0/blacklist.txt  --ignore-security-exc       
eptions --monitor-native-crashes -s 800 -v -v -v  --throttle 1427 180000 >sdcard       
/Monkey.log                                                                            
shes -s 800 -v -v -v  --throttle 1427 180000 >sdcard/Monkey.log               <        
Killed                                                                                 

首先在kernel log中搜尋索引鍵monkey,並根據monkey退出的log行向上查看如下:
<4>[ 2646.721739] (0)[474:AudioOut_2]AWD 8192AWD 8192======low memory killer=====
<4>[ 2646.781825] (1)[17854:sh]Free memory other_free: -1147, other_file:3990 pages
<4>[ 2646.781878] (1)[17854:sh]Candidate 1 (init), adj -941, rss 69, rswap 109, to kill
<4>[ 2646.781933] (1)[17854:sh]Candidate 87 (ueventd), adj -941, rss 56, rswap 64, to kill
。。。。。。
<4>[ 2646.784770] (1)[17854:sh]Candidate 17859 (roviders.global), adj -941, rss 1452, rswap 2652, to kill
<4>[ 2646.784825] (1)[17854:sh]Killing ‘commands.monkey‘ (7641), adj 0,
<4>[ 2646.784839] (1)[17854:sh]   to free 8504kB on behalf of ‘sh‘ (17854) because
<4>[ 2646.784852] (1)[17854:sh]   cache 15960kB is below limit 23552kB for oom_score_adj 0
<4>[ 2646.784867] (1)[17854:sh]   Free memory is -4588kB above reserved [gfp(0xd0)]
<4>[ 2646.784903] (1)[17854:sh]low memory info:
<4>[ 2646.784983] (1)[17854:sh]Normal free:3964kB min:2784kB low:7980kB high:8676kB active_anon:18352kB inactive_anon:18364kB active_file:6936kB inactive_file:6888kB unevictable:27196kB isolated(anon):0kB isolated(file):68kB present:485448kB mlocked:25284kB dirty:0kB writeback:40kB mapped:20816kB shmem:11948kB slab_reclaimable:18212kB slab_unreclaimable:52360kB kernel_stack:4120kB pagetables:5292kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:252 all_unreclaimable? no
<4>[ 2646.785058] (1)[17854:sh]Normal: 991*4kB 0*8kB 0*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 3964kB
<4>[ 2646.785334] (1)[17854:sh]LowMemoryOn
<7>[ 2646.785381]-(1)[17854:sh][17854:sh] sig 9 to [7641:commands.monkey]
<7>[ 2646.786094] (0)[7641:commands.monkey][7641:commands.monkey] exit
分析結果:從上面log已經可以很清楚的看到當前monkey被killed原因是由於低記憶體導致。monkey退出
前low memory killer已經開始頻繁殺記憶體了。且此時可以在log中搜尋commands.monkey的adj值為0(值越小表示優先順序最高,adj的值可以為負數,如像init進程的oom_adj為-16)

Android 低記憶體導致monkey killed分析指南

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.