차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
다음 판 | 이전 판 | ||
development:android:how_to_debug_memory_leakage_in_media_server_in_android [2014/07/18 22:57] – 새로 만듦 kim7463 | development:android:how_to_debug_memory_leakage_in_media_server_in_android [2020/09/25 10:12] (현재) – 바깥 편집 127.0.0.1 | ||
---|---|---|---|
줄 1: | 줄 1: | ||
- | Check memory leakage in media server. | + | CC: https:// |
+ | |||
+ | **Check memory leakage in media server.** | ||
Set libc debug level. So libc will record back trace for all memory allocate. | Set libc debug level. So libc will record back trace for all memory allocate. | ||
- | setprop libc.debug.malloc 1 | + | |
+ | * setprop libc.debug.malloc 1 | ||
Kill mediaserver to let the libc debug take effect. Android will restart mediaserver. | Kill mediaserver to let the libc debug take effect. Android will restart mediaserver. | ||
- | busybox killall -HUP mediaserver | + | |
+ | * busybox killall -HUP mediaserver | ||
you will see below log if you setting right. | you will see below log if you setting right. | ||
+ | |||
+ | < | ||
I/ | I/ | ||
+ | |||
Dump all used memory of mediaserver. | Dump all used memory of mediaserver. | ||
+ | |||
dumpsys media.player -m | dumpsys media.player -m | ||
+ | |||
Allocation count 297 | Allocation count 297 | ||
+ | |||
Total memory 1483423 | Total memory 1483423 | ||
- | size | + | |
- | size | + | size |
- | Diff two times of memory dump to check if there is any memory leakage. You can playback one video file between the dump. | + | 0x40146ec2, 0x4014a1ec, 0x4014a3ca, 0x00008a98, 0x400b67aa |
+ | |||
+ | size | ||
+ | 0x427f7e22, 0x42807648, 0x428082ea, 0x415144f0, 0x4151334a, 0x413381d0, 0x401dcbc, 0x401d438c, 0x4014d996, 0x405c3c46, 0x405c7516, 0x405c6ad4, 0x412c02ca, 0x412c0584, 0x4108c64c, 0x4107d622, | ||
+ | 0x4107fbf2, 0x4107c19a, 0x400b2eac, 0x400b2a00 | ||
+ | </ | ||
+ | |||
+ | Diff two times of memory dump to check if there is any memory leakage. You can playback one video | ||
+ | file between the dump. | ||
+ | < | ||
diff 1.txt 2.txt > diff.txt | diff 1.txt 2.txt > diff.txt | ||
+ | </ | ||
+ | |||
Get maps file of mediaserver. | Get maps file of mediaserver. | ||
+ | |||
+ | < | ||
adb pull proc/< | adb pull proc/< | ||
+ | </ | ||
+ | |||
Use attached script to map back trace to function symbols and file line. | Use attached script to map back trace to function symbols and file line. | ||
+ | |||
+ | < | ||
./ | ./ | ||
+ | </ | ||
+ | |||
Notes: should use eng build for the debug. | Notes: should use eng build for the debug. | ||
+ | |||
+ | |||
+ | Another Links : http:// |