Memory Analyzer Tool in android?

Solution 1:

  1. Open DDMS perspective in Eclipse.
  2. Select Devices tab.
  3. Choose a process you want to make a dump for.
  4. Click Dump HPROF file button. The dump will be made and MAT window will be opened, assuming MAT is installed.
  5. Choose Leak Suspects Report in the wizard window and click Finish.

That's all. You'll se a list of possible leaks, but some of them are false-positive. I recommend you to run an activity you want to check leaks in several times and then run MAT again.

Solution 2:

Try Using the Memory Analyzer Tool (MAT)

Look at these articles:

  • Using DDMS
  • Track Memory Allocations
  • Avoiding memory leaks

Also look at these SO Posts:

  • Android ==> Memory Analysing ==> Eclipse memory analyzer?
  • What Android tools and methods work best to find memory/resource leaks?

Solution 3:

Write to hprof fails when you have not used android.permission.WRITE_EXTERNAL_STORAGE. As a special case when you are testing on device, check if your SD card is connected in Charge ONLY mode otherwise you wont have write access on SD Card