I'm playing around in Android Studio to learn more about memory leaks.
What i noticed is that, after rotating the screen a couple of times, i see multiple instances of that activity (after clicking on "Initiate GC" and "Dump Java Heap").
But when i click 2 times on "Initiate GC", and click after that on "Dump Java Heap", i see that my activity and its inner classes have only 1 instance.
Why do i have to click twice on "Initiate GC" to clear the activity instances? Am I leaking memory or not?
Edit: I also noticed this happens when creating a new project with a blank activity. So i'm probably not leaking any memory, but i'd still like to know why the instances aren't destroyed on first GC