I decided it was high time I learned how to use Leak Canary to detect Leaks within my apps, and as I always do, I tried to implement it in my project to really understand how to
I can't open your image and see the actual leak but if you define a local variable for your RecyclerView
in your Fragment
and set your fragment's retainInstanceState
true
it can cause possible leaks with rotation.
When using a Fragment
with retainInstance
you should clear all your ui references in onDestroyView
@Override
public void onDestroyView() {
yourRecyclerView = null;
super.onDestroyView();
}
Here you can find a detailed information from this link: Retained Fragments with UI and memory leaks