Wednesday, June 16, 2010

Re: [android-developers] Re: Bitmaps and OutOfMemoryError: Best Practices needed

Bitmaps are allocated on the native heap but their size is counted
against the Java heap limit. You can use tools like MAT to see whether
you are leaking Bitmap objects but you can't rely on these tools to
measure the amount of memory used by those bitmaps. Thankfully, it's
very easy to figure out how much memory is used by a bitmap :)

On Wed, Jun 16, 2010 at 11:44 AM, Nathan <crittermap@crittermap.com> wrote:
>
> I tried the Eclipse MAT tool. Really cool stuff.
>
> Unfortunately, it appears blind to bitmaps, at least so far.
>
> I was relieved to find out that the 4 Megabyte bitmap is only taking
> up 32 bytes. ;)
>
> The cache of 25 bitmaps was listed as the biggest suspect. But with a
> retained heap of 600K, this only includes the original bytes, and
> doesn't tell me if any of the uncompressed bitmaps are taking up
> memory.
>
> This is going to be a serious limitation of tools if they can't see
> bitmaps, especially if bitmaps are your biggest suspects for leaks.
>
> Romain, do you know if you can make any tool see bitmaps?
>
> Nathan
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

--
Romain Guy
Android framework engineer
romainguy@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment