Page 1 of 1

Disposed instances with direct Eventandler roots

Posted: Mon Mar 25, 2013 9:20 am
by galastur
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

Re: Disposed instances with direct Eventandler roots

Posted: Mon Mar 25, 2013 10:23 pm
by Andreas Suurkuusk
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

Re: Disposed instances with direct Eventandler roots

Posted: Wed Apr 03, 2013 7:15 am
by galastur
Thanks Andreas Suurkuusk !