Forums
5
Product Forums
21
General Purpose MicrocontrollersGeneral Purpose Microcontrollers
i.MX Forumsi.MX Forums
QorIQ Processing PlatformsQorIQ Processing Platforms
Identification and SecurityIdentification and Security
Power ManagementPower Management
MCX Microcontrollers
S32G
S32K
S32V
MPC5xxx
Other NXP Products
Wireless Connectivity
S12 / MagniV Microcontrollers
Powertrain and Electrification Analog Drivers
Sensors
Vybrid Processors
Digital Signal Controllers
8-bit Microcontrollers
ColdFire/68K Microcontrollers and Processors
PowerQUICC Processors
OSBDM and TBDML
Solution Forums
4
Smart Home
Power & Energy
Mobile Robotics
Motor Control
Software Forums
16
MCUXpresso Software and ToolsMCUXpresso Software and Tools
CodeWarriorCodeWarrior
MQX Software SolutionsMQX Software Solutions
Model-Based Design Toolbox (MBDT)Model-Based Design Toolbox (MBDT)
FreeMASTER
eIQ Machine Learning Software
Embedded Software and Tools Clinic
S32 SDK
S32 Design Studio
GUI Guider
Zephyr Project
Voice Technology
Application Software Packs
Secure Provisioning SDK (SPSDK)
Processor Expert Software
MCUXpresso Training Hub
Topics
8
Mobile Robotics - Drones and RoversMobile Robotics - Drones and Rovers
NXP Training ContentNXP Training Content
University ProgramsUniversity Programs
Rapid IoT
NXP Designs
SafeAssure-Community
OSS Security & Maintenance
Using Our Community
Cloud Lab Forums
2
Hardware
Cloud Lab Knowledge Base
Knowledge Bases
11
ARM Microcontrollers
1
MCX Microcontrollers Knowledge Base
i.MX Processors
0
Identification and Security
0
Model-Based Design Toolbox (MBDT)
0
QorIQ Processing Platforms
0
S32 Automotive Processing Platform
0
Wireless Connectivity
0
CodeWarrior
0
MCUXpresso Suite of Software and Tools
0
MQX Software Solutions
0
i.MX RT Crossover MCUs Knowledge Base
Ideas
Blogs
Forums
Knowledge Bases
NXP Tech Blog
NXP.COM
Sign In
FAQs
Language
English (US)
日本語 | Japanese
中文 | Chinese (Simplified)
Home
:
i.MX Forums
:
i.MX Processors Knowledge Base
:
How to debug memory leakage in media server in Android
How to debug memory leakage in media server in Android
All community
This category
This board
Knowledge base
Users
Products
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
Show
only
|
Search instead for
Did you mean:
Options
Subscribe to RSS Feed
Mark as New
Mark as Read
Bookmark
Subscribe
Printer Friendly Page
Report Inappropriate Content
How to debug memory leakage in media server in Android
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
Report Inappropriate Content
04-04-2015
09:13 PM
Great!!
No ratings
Version history
Last update:
09-12-2012
10:27 PM
Updated by:
KevinSong