如何在发生java层的out of memory时 自动抓取对应进程的hprof
时间:10-02
整理:3721RD
点击:
在Monkey等自动化测试时,需要在出现java的out of memory问题时自动抓取hprof文
件(hprof会自动打包到aee_exp的db文件中)
1. 需要先从mainlog确认是否有合入DVM和AEE两部分的Patch.
mainlog中有出现如下log, 代表有合入DVM部分的patch
01-01 15:42:20.636 1310 1310 D dalvikvm: not gen hprof when oome
mainlog中有出现如下log, 代表AEE部分的patch有合入
01-01 15:42:21.407 12001 12001 E AEE/DUMPSTATE: copy_file: Copy /data/anr/1310.hprof to
PROCESS_OOME_HPROF failed(2), No such file or directory
2. 对应不同软件版本上的Patch ID:
ALPS.JB2.MP:ALPS00692776
ALPS.JB3.MP ALPS.JB3.TDD.MP: ALPS00828917
ALPS.JB5.MP: ALPS01210674+ ALPS00870675
JB9.MP以及KK之后的版本已经包含所需patch
3. 再保证有合入patch的前提下,还请按照如下方法在ENG版本上测试:
3.1. 连上adb执行如下命令(会自动重启,把电池开机后属性会无效,需要重新输入):
adb shell setprop dalvik.vm.oome-hprof-path /data/anr
adb shell chmod 0777 /data/anr/
adb shell stop
adb shell start
3.2. 开完机后清除mtklog文件夹,再开启mobilelog.
3.3. 然后复制问题,出现问题后等几分分钟,然后将mtklog发过来。
