mixpanel-android: Memory leak

Hi,

After some investigation on my app, I have detected an huge memory leak coming from Mixpanel (see attached pictures). For the moment I have no idea where it comes from but it appear as soon as I call : MixpanelAPI.getInstance(my_context, MIXPANEL_TOKEN);

The android studio allocation tracker confirms that it comes from the Mixpanel package.

Following my investigation :

  • If I call the flush method, the leak is stopped when the app is in the bakground.
  • If I don’t call the flush method, the leak is still present when the app is in the bakground.
  • If I call the getInstance(…) method with the wrong Token, I get no leaks.
  • I have tried with version 4.5.1 and the issue is the same (my current version is 4.6.4)
  • I have tried to move the Mixpanel initialization in another activity : same issue
  • Same issue on multiple android version (lollipop, kitkat …).

Any idea ?

Android studio : without_mixpanel without_mixpanel with_mixpanel with_mixpanel

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 18 (4 by maintainers)

Most upvoted comments

@yinfeiru Hey Yinfei! Any chance we can reopen this issue? Let me know if I can help with additional context.