I found the culprit. It is Google Analytics.

Warning to others, if you follow the instructions for Google Analytics
as described here, you will get a context leak:

http://code.google.com/mobile/analytics/docs/android/#startingTheTracker

Using the find path to GC, I found that the tracker, a singleton
instance, will hold a reference to the context even after you call
stop on it. As Romain is quick to tell us, a static reference to a
context is bad.

There is no way of correcting the situation once the tracker has an
Activity Context, so you can't give it one.

In the short term, I've replaced:
    tracker.start("UA-YOUR-ACCOUNT-HERE", this);
with
    tracker.start("UA-YOUR-ACCOUNT-HERE",
this.getApplicationContext());

I'm not sure how to let the Google Analytics team know that they at
least need to update their instructions. I will at least post it
here.

Nathan

On Jun 18, 10:44 am, Nathan <[email protected]> wrote:
> So far I'm still getting multiple activity instances. I've succeeded
> in saving some expensive objects by nulling out references in
> onDestroy
>
> So I haven't stopped a leak but I'm slowing it down.
>
> Nathan

-- 
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