차이
문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판이전 판다음 판 | 이전 판 | ||
development:android:how_to_debug_memory_leakage_in_media_server_in_android [2014/07/18 22:58] – 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/ | ||
줄 27: | 줄 30: | ||
0x427f7e22, 0x42807648, 0x428082ea, 0x415144f0, 0x4151334a, 0x413381d0, 0x401dcbc, 0x401d438c, 0x4014d996, 0x405c3c46, 0x405c7516, 0x405c6ad4, 0x412c02ca, 0x412c0584, 0x4108c64c, 0x4107d622, | 0x427f7e22, 0x42807648, 0x428082ea, 0x415144f0, 0x4151334a, 0x413381d0, 0x401dcbc, 0x401d438c, 0x4014d996, 0x405c3c46, 0x405c7516, 0x405c6ad4, 0x412c02ca, 0x412c0584, 0x4108c64c, 0x4107d622, | ||
0x4107fbf2, 0x4107c19a, 0x400b2eac, 0x400b2a00 | 0x4107fbf2, 0x4107c19a, 0x400b2eac, 0x400b2a00 | ||
+ | </ | ||
+ | |||
Diff two times of memory dump to check if there is any memory leakage. You can playback one video | Diff two times of memory dump to check if there is any memory leakage. You can playback one video | ||
file between the dump. | 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:// |