Trying to understand Dalvikvm and memory leaks

人走茶凉 提交于 2019-12-11 13:17:20

问题


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:

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.

!

Suspect 2 Dominator Tree


回答1:


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.



来源:https://stackoverflow.com/questions/23473555/trying-to-understand-dalvikvm-and-memory-leaks

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!