since yesterday I got the Xamarin Profiler running within my Visual Studio 2013. I’m using the Xamarin Profiler 0.18 with Xamarin 3.11.666.0
I’m working on a Xamarin Android Project where I want to do some quality improvements by checking for memory leaks and performance issues.
Yes ,I read through the manuals on the xamarin webpage:
and I have searched through a lot of forums.
The problem I currently investigate is that I have a custom made Dialog derived from DialogFragment, which probably causes a memory leak, but perhaps I just do wrong interpretation of the Xamarin Profiler data.
Here my questions about the Xamarin Profiler (for better understanding I have added 2 screen shots)
**Allocation List: **
a) What is the meaning of the “Live” column?
Sometimes there is a dot in the cell, which probably means alive and sometimes the cell is empty.
But what means “Live” at the end?
Sometimes this dot comes up without a reason at later point in time, when the dialog related to this row was already closed for a long time.
b) When will new allocation rows be added?
When I open my Dialog I expected that immediately after the Dialog opens a new row will be added in the allocation list.
This does mostly not happen, also if I wait for a long time. Mostly a new row is just added after closing the dialog and sometimes just when I close it and reopen it again.
In that case two new entries (rows) will be added at once (the previous and the actual one).
c) The “allocation list” rows for my dialog fragments never disappear.
I expected that the gc will clean up all the dialog fragment instances which were dismissed and not referenced anymore from time to time, but they never disappear.
In the 1st screen shot you can see that this Dialog Instance is still referenced from my NavDrawer-Activity.
All the other rows have no references anymore (because already dismissed) as shown in the 2nd screen shot.
So from Xamarin Profiler it looks like these dialogs are causing a memory leak, because they will never be cleaned up. Is that right?
I also tried to force the clean up by calling GC.Collect(); but they do not disappear.
I have searched through a lot of forums regarding DialogFragment’s causing memory leaks, but I think my implementation regarding .show(), dismiss() and so on is O. K.
So I could not find a reason how they could cause a memory leak.
I’m using the following support library: package id="Xamarin.Android.Support.v4" version="126.96.36.199" targetFramework="MonoAndroid44"
I will be very thankful for a view hints or advices.
Thanks in Advance and Best Regards