Posts

Showing posts with the label memory leaks

Memory and Resource Leaks in .NET Applications

Spanish version / Versión en Español The following is a (quite) short summary of this MSDN article Firstly, it is of vital importance to understand that a Garbage Collected environment such as Managed .NET is not immune to memory leaks. One of the reasons for this is the fact that .NET's Garbage Collector only disposes objects which are no longer referenced by any other object. Ergo, if an object's reference count does not reach zero because of a dangling reference, the GC won't save us. On the other hand, when we talk about .NET applications which run on Windows, said applications usually consume Operating System resources (bitmaps, thread handles, critical sections, etc). These should be, ideally, released as soon as they are no longer needed. The author of the MSDN article mentions a ninja technique to hunt down leaks: Nevertheless, he prefers using higher level tools, such as these Usual causes for memory leaks in .NET: Static referen...