I'm trying to trace memory leaks in my app. I have an Activity in which I can switch between 7 Fragments. I'm instantiating the Fragments in the Activity's onCreate() and using the same instances when switching between them.
I'm using Picasso to load any images in the Fragments. As I switch between the Fragments, the memory allocation keeps increasing and even on finishing the Activity, the memory is not freed.
I've used MAT to analyze the heap dump and it seems it's the Bitmaps that aren't being freed.
I understand that I have a leak in the Activity that contains the Fragments but since the the memory isn't being freed even after exiting the Activity, I guess I'm also holding onto the Activity also.
Since I haven't been able to use MAT in a beneficent way to identify the leaks (neither figure out where I'm holding onto the Activity), I'd appreciate if someone could help me out.