Hi,

Recently I've started developing my first fully Honeycomb optimized app.

It uses the setRetainInstance(true) to retain my list fragment on screen
rotations.

The odd thing is that I started to observe some very huge leaks on my app,
after a few (maybe 6 ou 8) screen rotations my app was getting an
OutOfMemoryError. So I go down to investigate it. After using some tips
from
http://android-developers.blogspot.com/2009/01/avoiding-memory-leaks.html I've
managed to down my leak by half, but it was still a HUGE leak.

So I went further, analyzing the heap dumps on MAT to discover that one
cause that I was leaking a Context on every screen rotation was the
ViewHolder Pattern.

After removing the ViewHolder pattern from my adapter, doing the
findViewById on every getView(), I no longer leak a context and managed to
take down my leaks to only 10 or 20k per rotation (which I'm still
investigating).

Anyone has gone through the same problem? Is that possible to use the
ViewHolder Pattern without leaking the Activity? Or is this Pattern
'deprecated'???

LĂșcio Maciel
[email protected]

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

Reply via email to