0

I am planning to hunt any memory leak in my Android App. After searching through different blogs, it seems like MAT is a good tool for that.

Before proceeding further, I just want to make something clear. When I check allocated heap memory in memory monitor tab of android studio, i can see the allocated memory increases by ~1 MB (from 16MB of initial allocation) each time I rotate my device. This, most probably suggests some leaks.

However in the process, at any stage, whenever I click on Garbage Collection button in memory minitor window to force GC, the allocated memory comes down to near the initial stage 16MB+ (sometimes requires 2 back to back click when allocated memory expands beyond 30 MB).

My question is, does this behavior suggests that I don't have any leaks due to strong references? If GC can collect those extra chunks, how important is that to check the issue?

abdfahim
  • 2,523
  • 10
  • 35
  • 71
  • I think that can be a good clue, but if you want find the cause of a possible memory leak I suggest you to use Eclipse Memory Analyzer. – GVillani82 Mar 09 '16 at 22:41
  • Unfortunately I use Android Studio, not eclipse. – abdfahim Mar 09 '16 at 22:43
  • 1
    In fact I use it in Android Studio. Take a look [here](http://stackoverflow.com/a/24547957/1584654) for understand how. Or look [here](http://www.theshiftingbit.com/Fixing-Memory-Leaks-in-Android-Studio) for a more detailed guide – GVillani82 Mar 09 '16 at 22:47

0 Answers0