0% found this document useful (0 votes)
23 views2 pages

Uses-Permission Uses-Permission: Android:name

MAT is a memory analyzer tool for android devices. It can be used to profile a device's memory. MAT will generate Heap Dump files for each process id. You'll need to Convert the hprof file to relevant format readable by memory analyzer tools. For understanding MAT go through it's documentation / wiki.

Uploaded by

osho1981
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views2 pages

Uses-Permission Uses-Permission: Android:name

MAT is a memory analyzer tool for android devices. It can be used to profile a device's memory. MAT will generate Heap Dump files for each process id. You'll need to Convert the hprof file to relevant format readable by memory analyzer tools. For understanding MAT go through it's documentation / wiki.

Uploaded by

osho1981
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Download Memory Analyzer Tool from http://www.eclipse.

org/mat/ (download
as RCP instead of plugin)

Set WRITE_EXTERNAL_STORAGE permission in app manifest file

<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"><
/uses-permission>

Install the app on device/emulator and launch the same.

Open an ADB shell

$> adb shell

Make the data/misc directory writable

#> chmod /data/misc 777

Search for the moofwd™ process ID

#> ps

The result will be something like this. Just note the process id associated
with com.moofwd.rca.main process.

Send a Heap Dump instruction for the process id

#> kill -10 276

Go to /data/misc directory and note the name of the file

#> cd /data/misc
#> ls –l heap*

The result will be something like this. Copy the name of the heap dump
file that you’re interested in.

For the next step, it’s better if you can have <Android Install Dir>/tools on
your system PATH.
On another command prompt window (NOT in the ADB SHELL) go to the
desired directory where you want to store the heap dump. It might be a good
idea to create a new sub-directory for each dump file because MAT will generate
a lot of files for each dump file during profiling.

Pull the HRPOF file from adb into your desired directory

$> adb pull /data/misc/heap-dump-tm1288354690-pid276.hprof .

Convert the HPROF file to relevant format readable by memory analyzer tools.

$> hprof-conv heap-dump-tm1288354690-pid276.hprof


moofwd1.hprof

Note: Both adb and hprof-conv commands are provided as android tools
and will need for android tools to be on the PATH OR you’ll need to call
them with their fully qualified path.

Start MAT as standalone RCP application. Go to File=>open and choose the file
created in the hprof-conv step above.

For understanding MAT go through it’s documentation/wiki @


http://wiki.eclipse.org/index.php/MemoryAnalyzer

You might also like