Although you know the general development of Android applications need to pay attention to the problem, but there are uneven levels of the situation, especially maintenance code, if memory consumption, memory overflow serious, how to solve it? --by Ddms the heap out to analyze
1. Open Ddms
2. Select the program you want to view, and click the Update heap icon
3. View the heap situation
But this is just a look at the usage of the heap, and if memory usage or overflow is found to be very serious, it will be oom. Through this is not see anything, this time need to take out the heap analysis, there is a button on the edge of the updateheap.
Click, will generate a file, save it (a little delay, patience, etc. oh, I saved to the desktop)
7. View the file you just downloaded, but to view before we need MAT
8, install the mat, the steps are basically on-line, the method is: eclipse-"help-" Eclipse marketplace-"Select memory analysis to the right of the install and then next step installation."
9.. hprof file conversion, files saved directly by DDMS cannot be viewed with mat and will be incorrectly formatted. This is the time to use the SDK with the tool Hprof-conv to convert.
C:\users\administrator>hprof-conv C:\Users\Administrator\Desktop\test.hprof C:\Users\Administrator\Desktop\ Hprofed-test.phrof
10. Use the mat to open the. hprof file to view memory usage.
As for the mat how to use Baidu or Google is still a lot of, or so I research to the value of Android, I will open a post to explain!
"Android" Development optimization--view memory situation, find memory leaks