Memory leak in xbap application

Posted by Arvind on Stack Overflow See other posts from Stack Overflow or by Arvind
Published on 2009-08-26T05:02:55Z Indexed on 2010/05/12 6:04 UTC
Read the original article Hit count: 640

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about memory-leaks

Related posts about wpf