获得黑莓总内存

问题描述:

我怎样才能得到所有运行的应用程序的总内存使用情况?基本上,我想找到的内存使用量是否大于30%以上。

How can I get the Total memory usage by all running applications? Basically I want to find whether the memory usage is greater than 30% or above.

由于拉斐尔的建议,你可以使用的内存类。更具体地说,可以使用下面这将帮助你:

As suggested by Rafael, you can make use of the Memory class. More specifically, you can use the following which will help you:

   Memory.getRAMStats().getFree();
   Memory.getRAMStats().getAllocated());

如果你比较两个数学上,你可以从该百分比。

If you compare the two mathematically, you can get the percentage from that.