Thanks for the responses.

android777 - Unfortunately it's a lot of code, but I pretty much just
load my bitmaps, and later on just call .recycle() on them. It's
possible there's a bug and some of the .recycle() calls aren't being
reached and I'm having a hard time tracking them down using profiling
tools.

Dianne - that explains a lot, thank you. Is there any way to get an
accurate (bitmap included) picture of the heap in pre-honeycomb builds
of an app?


On Feb 25, 9:14 am, Dianne Hackborn <hack...@android.com> wrote:
> Memory fragmentation does not cause this; the Dalvik heap limit is enforced
> based on the actual active allocations.
>
> Note that bitmaps are NOT include in the Dalvik heap based on what ddms
> reports, but they are included in the heap limit, so most likely you have a
> lot of bitmap data.
>
> (In HC this is changed and bitmap data is now allocated directly on the
> Dalvik heap.)
>
>
>
> On Thu, Feb 24, 2011 at 12:42 PM, Sheado <chad...@gmail.com> wrote:
> > Hello. I tried posting this earlier, but it didn't seem to stick (so
> > sorry if it double posts).
>
> > My app occasionally runs out of memory when loading bitmaps. I call
> > recycle() on every bitmap I'm done with and even set them to null.
>
> > As far as diagnostics:
> > * I ran ddms and never saw the heap go over 5.5mb. The largest image I
> > load is 480x320, so there's no way that pushing it over the 16mb
> > limit.
> > * I dumped the event log and noticed this at one point:
> > I/dvm_gc_info( 6655):
> > [7290888427799873005,-9036888781628737488,-3939943202692585437,9505022]
> > According to somebody else's post this could be bad (sorry I lost the
> > link to that post). (gdb) print (0xtop12 & 0x1ff) << ((0xbottom12 >>
> > 9) * 4)  ==> resulting in greater than 17mb
> > * to confirm this, I dump hprof and analyzed it with Eclipse Mat, but
> > all I saw was a peak usage of 2.1mb and a suspected leak of 700k
> > * Scouring the forums, I found this:
>
> >http://groups.google.com/group/android-developers/browse_thread/threa...
> > Could my problem really be due to memory fragmentation? My app does
> > load and unload(recycle) bitmaps often.
>
> > I don't know which of these to believe and what to do to prevent these
> > out of memory exceptions from ever happening again - or at the very
> > least I'd like to properly interpret the data I'm getting from these
> > logs and profilers.
>
> > any advice would be awesome!
> > thanks.
>
> > --
> > 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+unsubscr...@googlegroups.com
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com
>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to