Finding Managed Memory Leaks in WPF and Silverlight applications
It's been a while since the last post was online. We have been very busy in working on one of the very fun and important features for our WPF 4 release, and I will post more details about the feature later.
While taking short breaks, I've noticed a few blog posts about finding managed memory leaks in WPF as well as Silverlight applications, some have very detailed steps for locating and debugging the memory leaks, some also introduced samples and tools, I found them quite useful and interesting:
- Finding Memory Leaks in WPF-based applications - by WPF Performance team (our PM Jossef Goldberg). This post provided detailed steps in finding the leaks with sample apps, cause analysises and suggested fixes
- Where's your leak at? [Using WinDbg, SOS, and GCRoot to diagnose a .NET memory leak] - by Silverlight dev David Anson, it has a few good links and a very interesting sample
- Tracking down managed memory leaks (how to find a GC leak) - by Rico Mariani, it offers very detailed steps to follow in diagnosing memory leaks
Techniques and Tools:
- SOS: finding the method bound to an EventHandler with WinDbg - by Mark Smith
- WinDbg, a core part of the Debugging Tools for Windows
- CLR Profiler for .NET Framework 2.0 and How To Use CLR Profiler
Other useful resources:
- Simulating Weak Delegates for EventHandler-like Delegates - by Ian Griffiths
- Simulating "Weak Delegates” in the CLR - by Greg Schechter
- Updated WPFPerf Performance Profiling Tools for WPF - by WPF Performance team