Why doesn’t the GC kick in when the worker process is inactive?

I got the following question in my Getting started with windbg – post and I thought it might be worth posting the replies in a separate article: Hi Johan, about those threads with an ID of XXXX, should they go away after certain amount of idle time like 2 minutes? I am trouble shooting an…


The KB article every one should know about

Have you read http://support.microsoft.com/?kbid=307340? If not, I suggest you do so. If you need convincing or simply want to know why this problem occurs I suggest you keep reading. The problem described in the article above can cause your application to spike in CPU time, Memory usage or both. This will lead to your application…


Finalizers and weak references

What do finalizers and weak references have in common? Well more than you might think actually.   Finalizers Finalizers are clean-up code that will be run at the end of an objects life-cycle. You should only release native resources in the finalizer. When you use your object you should not the finalizer cleaning up after you….


Memory management in the .NET Framework

This is a subject that has been covered before and I have no intention of writing the ultimate post on the subject. Still I think this is something that every good developer should know. Why do I need to know this? My colleagues and I are quite often asked about the necessity of knowing how…


I am getting OutOfMemoryExceptions. How can I troubleshoot this?

Problem: You’ve written an ASP.NET application that is getting OutOfMemoryExceptions. Cause: Let’s find out… Resolution: Use Windbg to take a look at the heap.   Is it a leak? Take a look at the memory usage of you application using perfmon. If memory is slowly increasing and never released, then you have a leak. If…