Browse
Product Forums
Software Forums
Topics
Ideas
NXP.COM
Sign In
Help
Home
:
i.MX Forums
:
i.MX Processors Knowledge Base
:
How to debug memory leakage in media server in And...
How to debug memory leakage in media server in Android
All community
This category
This board
Knowledge base
Users
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Search instead for
Did you mean:
Options
Article History
Subscribe to RSS Feed
Mark as New
Mark as Read
Bookmark
Subscribe
Email to a Friend
Printer Friendly Page
Report Inappropriate Content
How to debug memory leakage in media server in Android
No ratings
How to debug memory leakage in media server in Android
Check memory leakage in media server.
Set libc debug level. So libc will record back trace for all memory allocate.
setprop libc.debug.malloc 1
Kill mediaserver to let the libc debug take effect. Android will restart mediaserver.
busybox killall -HUP mediaserver
you will see below log if you setting right.
I/libc ( 3074): /system/bin/mediaserver using MALLOC_DEBUG = 1 (leak checker)
Dump all used memory of mediaserver.
dumpsys media.player -m
Allocation count 297
Total memory 1483423
size 262144, dup 1, 0x401f4c18, 0x400b6152, 0x401a6568, 0x4061a95c, 0x40146cfa, 0x4019639c, 0x40146ec2, 0x4014a1ec, 0x4014a3ca, 0x00008a98, 0x400b67aa
size 178192, dup 1, 0x401f4c18, 0x400b6152, 0x4280adae, 0x427ffcee, 0x4280ae6c, 0x427ec75a, 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
Get maps file of mediaserver.
adb pull proc/<pid of mediaserver>/maps .
Use attached script to map back trace to function symbols and file line.
./addr2func.py --root-dir=../../ --maps-file=./maps --product=sabresd_6dq diff.txt
Notes
: should use eng build for the debug.
Tags
(4)
android
leakage
mediaserver
memory
Attachments
addr2func.py.zip
Comments
04-04-2015
09:13 PM
Mark as Read
Mark as New
Bookmark
Permalink
Print
Email to a Friend
Report Inappropriate Content
04-04-2015
09:13 PM
Great!!
Version history
Revision #:
1 of 1
Last update:
09-12-2012
10:27 PM
Updated by:
KevinSong
View article history