Use this forum to read, ask or inform about memory issues in the .NET Framework and third party components.
- Joined:Thu Jun 04, 2015 8:44 pm
clean up does not clean constructor
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
- Result after closing the view. As you can see the constructor still retains in the memory but the actual mainpage gets cleaned when view is closed.
- deep dive information of the mainpage constructor
- Joined:Wed Mar 02, 2005 7:53 pm
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.
SciTech Software AB
Users browsing this forum: No registered users and 1 guest