打开eclipse的heap工具(已经集合了ADT),查看android模拟器或者真机中的内存使用情况,发现heap里面未加载任何进程的使用情况。怎么回事?
------解决方案--------------------
是不是heap的大小不够:
在run的run configuration里,有个argument选项,在vm argument输入框里输入:
-Xms256m
-Xmx1024m
则可设定jvm的heap size最小为256m,最大为1024m
------解决方案--------------------
Displays some heap stats, updated during garbage collection. If, when a VM is selected, the VM Heap view says that heap updates are not enabled, click the "Show heap updates" button, located in the top-left toolbar. Back in the VM Heap view, click Cause GC to perform garbage collection and update the heap stats.
在devices 栏里面 点击一下update heap 按钮就行了。如下图所示,
点击了以后不会马上有,等下一次 gc 回收旧有了
------解决方案--------------------
我刚开始也不会用,我来教你吧:
1 在Devices下选择一个进程,并点击它上面的一排按钮的第二个进行update heap,也就是调试按钮边上那个。
2 第一步之后,点击heap工具的Cause GC 就可以了。
明白了吗,不明白的话加我QQ:522590434.