问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/7595427/get-total-memory-usage-in-blackberry