question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:18 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mbusaccacommented, Apr 20, 2016

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

0reactions
fred8commented, Apr 22, 2016

If you have some image for in app notification for eg, yes I saw the same and that lead to https://github.com/mixpanel/mixpanel-android/issues/308. Which should be fixed with the proposed solution or an alternate one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Memory leak - Wikipedia
In computer science, a memory leak is a type of resource leak that occurs when a computer program incorrectly manages memory allocations in...
Read more >
What is Memory Leak? How can we avoid? - GeeksforGeeks
Memory leak occurs when programmers create a memory in heap and forget to delete it. The consequences of memory leak is that it...
Read more >
Definition of memory leak - PCMag
When memory is allocated, but not deallocated, a memory leak occurs (the memory has leaked out of the computer). If too many memory...
Read more >
Memory leak - OWASP Foundation
A memory leak is an unintentional form of memory consumption whereby the developer fails to free an allocated block of memory when no...
Read more >
Memory Leaks and Garbage Collection | Computerworld
DEFINITION A memory leak is the gradual deterioration of system performance that occurs over time as the result of the fragmentation of a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found