I would like to get a size in bytes that states how much memory can I allocate at the moment.
Like when I get an OutOfMemoryError while trying to allocate a bitmap, it says "allocation size exceeds VM Budget" - so I would like to know what is the maximum amount of bytes I can allocate at the moment, so I can free resources accordingly in order to make way for new allocations.
How do I go about getting this number?
Thanks.
Asked
Active
Viewed 470 times
0
-
http://stackoverflow.com/questions/6487802/check-available-heapsize-programatically – L7ColWinters Jan 30 '12 at 19:54
-
[This](http://stackoverflow.com/questions/2630158/detect-application-heap-size-in-android) is probably what you're looking for. – Marvin Pinto Jan 30 '12 at 19:57