"I assume you mean any of my own bitmap caches..."
Yep, if you have any.

I don't have an issue when my app finishes. Memory seems to get
released quite OK. So far, repeatedly re-starting my app does not seem
to leak any (bitmap) memory.

By any chance, do you have Drawables cached (i.e. referenced through a
static variable, or in a map/collection that is referenced through a
static variable)? Drawables (BitmapDrawables in your case) hold on to
a reference of the activity in which they're used.

I've been bitten by leaking memory before. I try to avoid mutable
static variables in Android as the plague. And, if i really need one,
i make absolutely sure the static variable is either cleaned up
properly (set to null) and/or that it holds no (indirect) references
to activities.

On Apr 30, 4:39 pm, Ward Willats <goo...@wardco.com> wrote:
> Thanks for these tips.
>
> At 1:14 PM -0700 4/30/09, Streets Of Boston wrote:
>
> >In my app, i've been dillegently 'unloading' bitmaps when i need
> >memory.
> >- clear any bitmap cache
>
> I assume you mean any of my own bitmap caches...
>
> >So far, this scheme has served me well. Before i got a lot of OOM-
> >errors. Now i get a looooot less. And, if i still get one, i try to
> >handle it gracefully.
>
> It still seems like Voodo to me. If I have to manually call
> setImageBitmap(null) it implies (to me) that the image view is not
> being released in the first place, which means the view hierarchy is
> not being released, even though I have called finish(). At the moment
> I am looking for static variables and leaked contexts....
>
> -- Ward
--~--~---------~--~----~------------~-------~--~----~
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