Monday, January 16, 2012

Android Application Performance Improvement (using DDMS/Traceview/MAT tool): Part-2

DDMS - Memory Allocation Tracker

DDMS provides a feature to track objects that are being allocated to memory and to see which classes and threads are allocating the objects. Memory Allocation Tracker allows the following:
  • Memory Usage
  • Tracking of memory allocated to objects
  • Tracking of threads & classes that are allocating objects
In DDMS, Devices tab is on left side from where you can select the device and the process running for your application and then, you can see the various log reports under different tabs on the right side.
On running the application, you can analyse the memory usage as well. In DDMS, after the selecting application process, select Allocation Tracker tab from the right side panel.
Select Start Tracking Button to start the memory allocation tracking. You can navigate through the application/screens where you want to track the memory usage.
Click Get Allocations to see a list of objects that have been allocated since you clicked on the Start Tracking button. You can click on Get Allocations again to append to the list new objects that that have been allocated.


It will display Allocation order, size, class and thread for each object. On selecting any object, it will fetch the details of selected object like, Class, Method, File and Line number in the file. This allows you to track, in real time, where objects are being allocated when you perform certain actions in your application. This information is valuable for assessing memory usage that can affect application performance.
Hope now you can take advantage of MAT tool(provided by DDMS) to improve the performance of your application.
Note: However, The Eclipse has also provided a MAT tool which provides quite a strong features to improve the application memory usage. The later parts of this post will cover it. Keep an eye!! J

2 comments:

  1. I like your blog performance.This is one of the useful post.I like your blog advantages.Good work.Keep it up.

    ReplyDelete
  2. Its a interesting blog and you information good one to read , so i got a good knowledge as wells as nice entertainment from your blog. thanks for providing this wonderful blog. Hire Android App Developer

    ReplyDelete