tags:

views:

87

answers:

1

In my android app, is there any way to get the total amount of memory my application is taking up, in the code. I'm using lots of large bitmaps, so it must include external allocations as well. I must, however, be able to get the number in the code, so that I can dynamically adjust to fit the budget I have.

I also need a way to get the total amount I have available (16Mb or 24Mb) as well.

Thanks!

A: 

Then you should rewrite it to not use so much memory. Any time working with multiple large bitmaps you are liable to run out of memory. You need to downsample the image, e.g. there is no point in load a full 8MP photo when your device can't display the full size image.

Here is a great answer regarding memory usage on Android.

BrennaSoft
That's not an option nor the answer I'm looking for. As I explained in the comment, my app is literally impossible to write without using the memory it uses. I can scale it down, but I only want to do that when I am low on memory in general.
GuyNoir
The application is as optimized as physically possible.
GuyNoir