Hi,
We are using many custom controls by inheriting form the WPFcontrols as the base and customizing it for our need.
However, the memory used by these controls are not released, even after pages using the controls are closed, until the whole application is closed.
As these application has to work for a whole day performance decreases as more and more memory gets held up.
When we profiled our page we found that the controls where not getting collected as there where some binding reference or some borders or brushes etc not getting cleared from that control.
We tried to use the Unload event of the controls to remove the events and some references from the control. This reduced the leak to some extent but this was slowing down closing of the page also the unload event was getting triggered when the control was even collapsed.
Is there any other ways to overcome the leak? Are there any best practices to prevent memory leaks?
Thanks
Arvind