Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find out the memory footprint of my Android App?

Well, the title says it.

It would also be handy to know how many memory is still available. I am writing a memory hungry application that tends to crash randomly (in native Code), and my suspicion is that it gets out-of-memory.

like image 265
Thilo Köhler Avatar asked Feb 27 '23 12:02

Thilo Köhler


2 Answers

I think you'd struggle to find a more comprehensive answer than this on the subject:
How do I discover memory usage of my application in Android?

like image 163
Christopher Orr Avatar answered Mar 02 '23 02:03

Christopher Orr


i agree with hackbod's reply. As far as my understanding goes, your app wont crash , rather it will be killed. you may find this discussion interesting
Is there a need to check for NULL after allocating memory, when kernel uses overcommit memory.
I guess there is some call back to know lowmemory conditions(onLowMemory()), you can use it to identify low memory conditions, I havent tried it though.

like image 29
FL4SOF Avatar answered Mar 02 '23 01:03

FL4SOF