Home > DeveloperSection > Forums > How do I discover memory usage of my application in Android?
ben reitman
ben reitman

Total Post:96

Posted on    May-29-2015 12:40 AM

 Android Android 

 1 Reply(s)
 511  View(s)
Rate this:

How can I find the memory used on my Android application, programmatically?

I hope there is a way to do it. Plus, how do I get the free memory of the phone too?

Mayank Tripathi
Mayank Tripathi

Total Post:397

Posted on    May-29-2015 7:37 AM

Yes, you can get memory info programmatically and decide whether to do memory intensive work.

Get VM Heap Size by calling:

Get Allocated VM Memory by calling:

Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
Get VM Heap Size Limit by calling:

Get Native Allocated Memory by calling:

tere is an app to figure out the OutOfMemoryError behavior and monitor memory usage.


You can get the source code at https://github.com/coocood/oom-research

Don't want to miss updates? Please click the below button!

Follow MindStick