I\'m maintaining a web application that has a memory leak.
Based on my investigation using Red Gate ANTS memory profiler I\'m pretty sure that the memory leak is cau
First off, just to prove the point, try logging the adding and removal of events to a simple text file. Then, check how many were added vs removed.
It sounds as if there is a bug somewhere in the business logic which is not unregistering the event in all circumstances.
The Dispose method on the collection should be called directly by your code because the event holds a reference to the collection. Your collection will never be destroyed by garbage collector.
You should also change the behaviour of the Remove and Clean methods of the collection to detach the event handler from the removed items.