[轉(zhuǎn)]android native層memory leak分析辦法
原文在這里
- adb shell setprop libc.debug.malloc 1
- adb shell ps mediaserver
- adb shell kill <mediaserver_pid>
- Call dumpMemoryAddresses(). (in MemoryLeakTrackUtil.cpp).
- $ adb pull /proc/<mediaserver_pid>/maps
- get the diff file of memory allocations
- $ adb pull /data/000 .
- $ adb pull /data/111 .
- $ diff 000 111 >diff_0_1
- $ ./addr2func.py --root-dir=../ --maps-file=./maps diff_0_1

