-
Notifications
You must be signed in to change notification settings - Fork 363
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
MixpanelActivityLifecycleCallbacks leaks activities #463
Comments
After investigating further I saw that library version 5.0.2 does not leak. Problem is in 5.1.0 in the line 81 of MixpanelActivityLifecycleCallbacks. You could get minimumSessionDuration and sessionTimeoutDuration variables in MixpanelActivityLifecycleCallbacks constructor or at least use context from an instance variable or MixpanelAPI instance. |
I'm seeing this as well. It's causing some major memory leaks in my app. Any progress on a fix? |
+1 on this leak. |
Thanks a lot for reporting this @mindhacker42 and thanks @mwolfe38 @JasonSznol for confirming the issue! |
Have you published the updated version to a maven repository? Gradle is saying it can't be found and I did not see it in bintray last night. |
@JasonSznol Can you try now? Thanks! |
Can confirm it is working, thanks! |
Amazing. Thanks for your help @JasonSznol ! |
Hi @patedit i'm having the same issue using the 5.2.1 version : `* xxxxxxx.MyActivity has leaked:
|
Oups, sorry @patedit, we had a class named 'MixpanelActivityLifecycleCallbacks' in our code too which is extremly closed to yours. So it was a problem on my side :) Wrong alert |
Library version: 5.1.0
LeakCanary trace:
I looked at the code and I saw that you register for activity lifecycle callbacks to measure session duration and other stuff. You can disable other stuff but you can't disable measuring session duration.
Problem occurs when you capture activity object in Runnable and you retain that in variable and since MixpanelActivityLifecycleCallbacks lives forever in MixpanelAPI singleton that Runnable never gets GCed.
The text was updated successfully, but these errors were encountered: