++wythern++

X presents Y for a better Z

[转]android native层memory leak分析办法

原文在这里

    • adb shell setprop libc.debug.malloc 1
    • adb shell ps mediaserver
    • adb shell kill <mediaserver_pid>
  1. Call dumpMemoryAddresses(). (in MemoryLeakTrackUtil.cpp).
  2. $ adb pull /proc/<mediaserver_pid>/maps
  3. get the diff file of memory allocations
    • $ adb pull /data/000 .
    • $ adb pull /data/111 .
    • $ diff 000 111 >diff_0_1
  4. $ ./addr2func.py --root-dir=../ --maps-file=./maps diff_0_1

posted on 2012-07-12 19:51 wythern 阅读(1518) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理