Trying to understand Dalvikvm and memory leaks

2019-08-07 00:17发布

I am trying to wrap my head around finding memory leaks. I suppose the first step is to see if i have one by looking at the dalvikvm but i am not really understanding whether it is good or bad. Here is a snap shot of my dalvikvm log: enter image description here

could someone just speak a bit to what is seen above. What are red flags? what is normal?

In addition, i have installed MAT for eclipse and while there are many links to tutorials about using MAT to find memory links, none of them seem to really explain how they find the leaks

can anyone point to a Detail tutorial for MAT.. below are some screen shots from my MAT Leak Suspects report.. I don't know what to make of it. If someone could talk me through the screen shots it would be much appreciated.

leak suspects!

Suspect 2 Dominator Tree suspect 2 dominator tree

1条回答
Lonely孤独者°
2楼-- · 2019-08-07 00:28

As the hprof's result(MAT), the largest memory used by the android app is graphics/bitmaps. This is the common situation in Android apps. You can use Android Heap profile to track the memory allocation.

Here you can use showmap to see the detail of Android app memory usage in native or java-heap.

And the way to find the memory leak is to use procrank/ps seeing the PSS/USS trend. If the trend is always increasing, there may be memory leaks. And then, you can use MAT to compare hprof for increasing java-heap.

查看更多
登录 后发表回答