0

I left my app running in the foreground on aSamsung Galaxy note 3 for 24 hours. I took a RAM snapshot in the beginning.

{"AvailableSystemRAM":1341,"AvailableAppRAM":10,"TotalAppRAM":49}

alter 12 hours:

{"AvailableSystemRAM":1265,"AvailableAppRAM":4,"TotalAppRAM":52}

after 24 hours the result is:

{"AvailableSystemRAM":992,"AvailableAppRAM":0,"TotalAppRAM":61}

Is it a sign of memory leak or other apps and services processing in the background? I presume that Android would throw an OutOfMemoryError if I used all the availableAppRam.

UPDATE

The answer is yes. Some native functions caused a minor memory leak that wasn't visible in Android Studio's memory monitor.

Endre Börcsök
  • 477
  • 1
  • 8
  • 19
  • possible duplicate of [How to increase heap size of an android application?](http://stackoverflow.com/questions/11275650/how-to-increase-heap-size-of-an-android-application) – nukeforum Sep 18 '15 at 15:31
  • You got me wrong. I don't need to increase the heap, but I'm interested how it works really. Can I use more RAM than the heap limit, or that would throw an OutOfMemoryError? So can I leak 400MB of RAM on an Android device, or that is impossible by design. – Endre Börcsök Sep 18 '15 at 15:54
  • I see. I was confused by the title.. Although I'm not sure what you could change it to in order to clear up the confusion. I actually just ran into an issue like this at work. We were getting `OutOfMemoryError` on certain devices after a gigantic mystery allocation. So, I guess anecdotally, you'll just get an OOM Exception at a certain level of consumption. – nukeforum Sep 18 '15 at 16:16
  • You should monitor the heap of you app, not the total heap of your device if you want to find out if you app has memory leaks. – barq Mar 22 '16 at 20:38
  • It is true generally. But in this case I had a tiny memory leak in the native environment that led to unexpected application closes on the long run. – Endre Börcsök Mar 22 '16 at 20:41

1 Answers1

0

I was using this to convert my images. Later I found a report about this method here:

https://issuetracker.google.com/issues/36997431

Endre Börcsök
  • 477
  • 1
  • 8
  • 19