|
Adding and removing event handlers: msg#00128windows.devel.dotnet.web
We have a web app where we are experiencing OutOfMemoryException errors fairly regularly particularly with concurrent use of the same pages. The pages that cause the problem most frequently have several handlers delegated to handle events using AddHandler() (VB not C#). Unfortunately we have forgotten to tidy up the handlers using RemoveHandler (). My understanding is that this can cause memory leaks because the objects handling the events (in this case, the pages) always remain in memory because there is always a reference to them. My suspicion is that this is the cause of our problem but my question goes further than this. Should event handlers be removed in a particular order with respect to the order they are added? eg. should they be removed in the same order, reverse order or doesnâ??t it matter? Most of the handlers are added in the Load handlers of pages and user controls. I assume that a good place to remove them would be in the Unload handler for these controls. Am I correct? Is there a recommended pattern for adding and removing event handlers? Thanks for any advice you can give. Alan Williams RTIX Ltd. =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Security/Permission issue with OWC 11.0 on a Win dows 2003 server: 00128, Marvin Smit |
|---|---|
| Next by Date: | Re: log4net -- Is it the best?: 00128, Jeremy Lew |
| Previous by Thread: | Re: Security/Permission issue with OWC 11.0 on a Win dows 2003 serveri: 00128, Marvin Smit |
| Next by Thread: | Re: log4net -- Is it the best?: 00128, Jeremy Lew |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |