- Posted by miketeye on July 4, 2008
Share on FacebookThis was such a life saver, I had to quickly document it here to save someone else the trouble. To begin with I am surprised, there are not that many hits on google about this particular setting in the aspnet.config file which can continously crash your server over and over.
This is the issue, I maintain an Asp.Net 2.0 web application which runs in its own application pool on a 64 bit multi-processor virtual server hosting space. The KEY here is the multi-processor bit. Apparently, the .Net Common Language Runtime (CLR) uses a server garbage collector in such environments which allocates a separate garbage collector instance for each processor's separate memory heap. This can very quickly result in excessive memory usage during garbage collection and eaily bring the server down and start displaying Server Unavailable messages to clients.
Well, that is the issue, what of the solution?. As it happens, there is a very simple solution. To workaround this behavior, configure the CLR to use the Workstation garbage collector:1. Open the Aspnet.config file in Notepad.exe. The file is located at %SystemRoot%\Microsoft.NET\Framework\v2.0.50727\Aspnet.config for .NET Framework 2.0 and at %SystemRoot%\Microsoft.NET\Framework\v1.1.4322\Aspnet.config for .NET Framework 1.1.2. In the section httpRuntime, add <<gcServer="false" />> (only one set of angle brackets!!) 3. Save the Aspnet.config file.