Reputation: 3014
I'm developing a graphics-intensive application for Android 2.2 and above.
I know that starting with Honeycomb, bitmaps are stored on VM_HEAP instead of their native bitmap heap.
Does this influence the effective memory usage of my application? I mean, e.g., if my app for pre-Honeycomb devices uses X MB of the VM heap, and has Y MB bitmaps (stored on native heap), then I hope it won't start using X+Y MB from the VM heap if it's installed on a Honeycomb or newer device.
This does not sound logical. Instead, I guess that bitmap size is counted against the VM limits even prior to Honeycomb, otherwise why would "bitmap size exceeds VM budget" errors appear? So they're stored on their native heap but still counted against VM_HEAP size maximum).
Upvotes: 4
Views: 1016
Reputation: 3014
I was also worried, but I got an answer from Google in the meantime, which confirmed my following assumption:
"This does not sound logical. Instead, I guess that bitmap size is counted against the VM limits even prior to Honeycomb, otherwise why would "bitmap size exceeds VM budget" errors appear? So they're stored on their native heap but still counted against VM_HEAP size maximum)."
Answer from Romain Guy (Android Framework engineer):
"That's correct. Your app will use the same amount of memory pre and post Honeycomb. "
Upvotes: 3
Reputation: 14058
AFAIK It was changed in honeycomb . Bitmaps are now stored in your dalvik heap(VM_HEAP) and not native heap as in previous versions. (Maybe because they didn't want to depend to SKia GC any more)
One now needs to take care of managing bitmaps more seriously as bitmaps working well on 2.2 could give an OOM exception in 3.0 as the same image is taking more pixels on a tablet (may not apply to 4.0, not sure).
Upvotes: 0