Premise:
Running the app
Ddms--update Heap
Click GC to observe heap (mainly see the totle size of data object)
Continue to operate the app
Memory leak (totle size of data object grows until system limit is reached, system no longer allocates memory, app crashes)
Pre-Analysis Preparation:
Get the memory leak file
DDMS, click the toolbar dump prof file to save the leaked file
File conversions
Win+r-cmd--hprof-conv xxx-a.hprof Xxx-b.hprof
Mat Analysis:
Histogram--shallow Heap Sort-list objects-withincoming references--gc root, very well positioned
A.histogarm View
B.shallow Heap Sort, choose the biggest one
C.list objects-withincoming References
D. Then select the max shallow heap, GC root, find the path chain
E. Positioning end (starting from the bottom shallow heap is incremental, retained heap change is not so big, the bottom is the layer of the problem)
Mat Download Address:
http://www.eclipse.org/mat/downloads.php