关于Android的内存的各种监测方法

来源:互联网 发布:淘宝上的拔步床能买吗 编辑:程序博客网 时间:2024/05/22 10:43

Android 检测内存的文章实在比较多,方法也挺多,于是得写一篇文章顺理一下了


目前我最常使用的,尤其是解决Bitmap OOM时用的都是MAT,但是我对里边的很多内容并不理解,我还是记下的博客写在case Demo里了


==

即使是Android官方文档,也有很多文章让我理不着头脑,先放一块吧:

https://developer.android.com/tools/debugging/debugging-memory.html

https://developer.android.com/training/articles/memory.html

上边那个是用adb shell dumpsys的,也是我想学的一种方法    

下边那篇的文章并没有直说是ram的监视,但是可以看heap usage of a process  ,tracking memory allocation of objects
这两个我并不懂,所以也记一下

http://developer.android.com/tools/debugging/ddms.html#running


==

还有一种想法是动态的把内存打出来,只是想法

http://stackoverflow.com/questions/5963402/android-how-to-track-the-memory-usage-of-an-any-running-app-on-device-programm



==

还有一种是用linux 的命令去监察内存实时变动,也只是想法

0 0
原创粉丝点击