Page 1 of 1

clean up does not clean constructor

PostPosted: Tue Feb 09, 2016 11:42 pm
by bhargava381
Hi Admin,
We have been using this .net memory profiler for a while. Recently, we started the optimization cycle and when we started profiling the application. We have noticed some unexpected behavior
This is what is happening:
When I close the view , the actual view gets removed from the memory .But, the constructor still retains in the memory after clean is done.
Can you please review and suggest the needful

Thanks,
Bhargava

Re: clean up does not clean constructor

PostPosted: Wed Feb 10, 2016 8:24 pm
by Andreas Suurkuusk
The MainPage.c<> class is not the view constructor. It's a helper class created by the compiler to implement anonymous delegates. Only one instance of this class will be created, and it will not be GCed until the AppDomain shuts down (it has a static field reference as a root). The size of the instance is only 12 bytes and since only one instance gets created, it's not a memory leak, just an implementation detail.

I hope this helps.

Re: clean up does not clean constructor

PostPosted: Wed Feb 10, 2016 11:58 pm
by bhargava381
Thanks..