---
title: "How do I discover memory usage of my application in Android?"  
description: "How do I discover memory usage of my application in Android?"  
author: "Anonymous User"  
published: 2015-05-29  
updated: 2015-05-29  
canonical: https://www.mindstick.com/forum/23270/how-do-i-discover-memory-usage-of-my-application-in-android  
category: "android"  
tags: ["android"]  
reading_time: 1 minute  

---

# How do I discover memory usage of my application in Android?

How can I find the [memory](https://www.mindstick.com/blog/300050/what-causes-sudden-memory-loss) used on my [Android application](https://www.mindstick.com/forum/33405/how-to-get-the-build-version-number-of-your-android-application), programmatically?

I hope there is a way to do it. Plus, how do I get the [free](https://www.mindstick.com/articles/12963/3-free-things-to-do-in-valletta) memory of the [phone](https://www.mindstick.com/articles/23411/the-most-effective-method-to-find-the-perfect-small-business-phone-system-for-your-business) too?

## Replies

### Reply by Anonymous User

Yes, you can get memory info programmatically and decide whether to do memory intensive work.\
Get VM Heap Size by calling:\

```
Runtime.getRuntime().totalMemory();
```

Get Allocated VM Memory by calling:\

```
Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
```

Get VM Heap Size Limit by calling:\

```
Runtime.getRuntime().maxMemory()
```

Get Native Allocated Memory by calling:\

```
Debug.getNativeHeapAllocatedSize();
```

tere is an app to figure out the OutOfMemoryError behavior and monitor memory usage.\
https://play.google.com/store/apps/details?id=net.coocood.oomresearch\
You can get the source code at https://github.com/coocood/oom-research


---

Original Source: https://www.mindstick.com/forum/23270/how-do-i-discover-memory-usage-of-my-application-in-android

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
