-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak in AppboySlideupManager #40
Comments
Thanks for reporting @MichaelEvans - do you have steps to reproduce? |
@MichaelEvans Just pinging on this incase the opening and closing of the issue messed up the signal. |
Sorry, totally missed notifications for this. Still seeing some in 1.8.0. Try this 😄 https://github.com/square/leakcanary |
Hi @MichaelEvans we can reproduce and we'll have a fix out in an upcoming release. We'll update on timing as the release approaches. Thanks very much for reporting. |
Hi Again @MichaelEvans It appears that this is a false alarm. AppboySlideupManager is a singleton static instance that persists throughout the life of the process it's in. Therefore, it should not be garbage collected. When looking at what LeakCanary's RefWatcher does:
...
So because our static singleton AppboySlideupManager is always supposed to be around, it's never going to be cleared by a GC. In fact, LeakCanary seems to throw that same error if we added a Please let me know if there's more information regarding this leak or if you agree with this analysis and we can close this. Thanks! |
Hi @MichaelEvans have you had a chance to take a look at this? Do you agree with this assessment? Please let us know as it'd be good to close this out if it's not an issue or keep investigating if it is. |
@briancaw I think the problem is that you need to disassociate this from the Activity. By keeping this reference, the Activity can never be GC'd. If you want to keep it around always, maybe using the Application context is a better idea? |
don't think application context is good here since they create views from On Wed, Aug 12, 2015 at 7:44 PM, Michael Evans notifications@github.com
Have a great day. Yishai Levenglick |
That's right @yishai-glide we do need the activity. @MichaelEvans we change the activity we point to with mActivity on every onResume/onPause (per integration instructions calling register/unregisterInAppMessageManager in those methods) so it's only pointing to the current activity, so the previous one should only be kept around for a very short period of time. Are you seeing activities being persisted in memory for long periods of time as a result of this? We have not seen that behavior in our testing. Incidentally, after this initial investigation we did update our code to null out mActivity in unregisterInAppMessageManager, but more for code cleanliness and to make the functionality more explicit. That'll be in the next release. |
maybe use a WeakReference? On Wed, Aug 12, 2015 at 7:53 PM, briancaw notifications@github.com wrote:
Have a great day. Yishai Levenglick |
@briancaw nulling out |
We've implemented the nulling out of |
Looks like you're leaking
sInstance
. 👎The text was updated successfully, but these errors were encountered: