How to receive a full GC notification with .NET 4.0

While scanning GC class members in IntelliSense with VS 2010 I noticed a few that looked unfamiliar. Turns out new feature allows receiving full GC notifications using the following methods: GC.RegisterForFullGCNotification(..) GC.CancelFullGCNotification(..) GC.WaitForFullGCApproach(..) GC.WaitForFullGCComplete(..) This is how MSDN explains the main user scenario for these notifications: There are situations in which a full garbage collection by…

1

Data and UI Virtualization in WPF

  The topic of virtualization is somewhat complex but at the same time pretty well covered on MSDN and blogs. I am quite sure I won’t be able to contribute anything new to the general pool of knowledge on this topic. Instead I would like to summarize some of the key points I’ve recently learnt…

2

DispatcherTimer and Managed Memory Leaks

Recently, while diagnosing a managed memory leak,  we found a scenario where a running DispatcherTimer can cause an object to be ineligible for garbage collection.Here’s how it can happen: when a DispatcherTimer is started, it is adding itself to _timers list of the current Dispatcher. So the Dispatcher is holding to the DispatcherTimer and the…