Created attachment 21982 [details]
According to Xamarin Profiler, Android Activities are not being garbage collected when device is rotated multiple times.
I am using Xamarin Profiler on a simple sample project that has a call to `GC.Collect()` in the main Activity's `OnCreate` method. After rotating the device multiple times, inspecting a snapshot reveals more than one instance of the Activity is marked as 'Live' in the Profiler. I assume 'Live' means that the object is unable to be garbage collected.
I can observe this whether or not the "Don't Keep Activities" setting in the Android developer options is enabled.
* Xamarin Profiler 1.4.0-1
* Xamarin Studio 6.3
* Xamarin.Android 22.214.171.124 (VS Enterprise)
* macOS 10.12.4
* Android Emulator with Nexus 5 configuration running Android 7.1.1
Maybe I am not understanding the intended behavior, but from what I understand about how the Mono VM GC works on Android, these Activities should be destroyed by the call to `GC.Collect()` or even the snapshot feature in the profiler.
Created attachment 23227 [details]
Profiler at beginning of session
Created attachment 23228 [details]
Profiler after 7 rotation cycles
Confirmed via Visual Studio 2017 Enterprise and Xamarin.Android 126.96.36.199 on Windows.
The before.png screenshot shows the beginning of the profiler session. Note that Andleaks.MainActivity count is 1. After 7 rotation cycles (Nexus 5), the Andleaks.MainActivity count goes to 15 (see after.png).