开发者

Is there a way to visualize the activity stack (activities in memory) on Android?

I'm currently debugging my app which is quite complex and has up to 5 activity levels. In order to detect memory leaks (i.e. activities that aren't removed from memory even finish() is called, due to some references held somewhere) I want to check which activities are sti开发者_开发知识库ll alive in memory.

Currently I create hprof dumps, but it's not very convenient, cause every time I need to mount the sdcard, copy the hprof dump file from the sdcard to my PC, etc.

(Side note: I already tried to automate the pulling of my hprof file more easily, but I'm on an unrooted device and adb pull <hprof file> won't let me / no permission.)

Therefore I am wondering, if all I want to know is IF and WHICH activities are still currently alive in my memory, is there a way through the Android API or any other way on-the-fly with which I can achieve this (list all alive activities of my app), programatically.


cause every time I need to mount the sdcard, copy the hprof dump file from the sdcard to my PC, etc

You can use Eclipse's File Manager view while your phone is in Debug mode to copy data from your device, without mounting the SDCard.


I figure there's no way to visualize the activity stack within Android itself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜