Disposed instances with direct Eventandler roots

Use this forum for questions on how to use .NET Memory Profiler and how to analyse memory usage.
Post Reply
galastur
Posts: 2
Joined: Mon Mar 25, 2013 8:28 am

Disposed instances with direct Eventandler roots

Post by galastur » Mon Mar 25, 2013 9:20 am

Hi,

I am trying to find which event handler has not been unregistered but I am not sure I am interpreting the data right (this is the first time I am using the memory profiler). You can see the the prf session https://docs.google.com/file/d/0B2pZ8nt ... sp=sharing

I want to get rid of : Request.StackPanelFields,this is a stack panel that gets created dynamically. It contains text boxes, labels, drop downs, buttons, etc. The question is I dont know which eventhandler is not being unregistered

Hope some one can get me in the right direction.

Thanks

Andreas Suurkuusk
Posts: 1029
Joined: Wed Mar 02, 2005 7:53 pm

Re: Disposed instances with direct Eventandler roots

Post by Andreas Suurkuusk » Mon Mar 25, 2013 10:23 pm

There are a lot of EventHandlers that keep the StackPanelFields instance alive, but as far as I can see, all event sources should also be eligible for GC as well, so there should be no need to remove the EventHandlers. Instead, the root of the memory leaks seems to be the DeferredActions hashtable in the ControlTemplate class (see graph below). This is unfortunately a memory leak in the .NET Framework, but it has been fixed in .NET Framework 4.0. For more information, see http://blog.ramondeklein.nl/index.php/2 ... nimations/.
deferredactions.png
DeferredActions
Best regards,

Andreas Suurkuusk
SciTech Software AB

galastur
Posts: 2
Joined: Mon Mar 25, 2013 8:28 am

Re: Disposed instances with direct Eventandler roots

Post by galastur » Wed Apr 03, 2013 7:15 am

Thanks Andreas Suurkuusk !

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests