ASP.NET Garbage Collection


 

You can improve performance by switching garbage collector modes under certain scenarios.  There are two modes, Server and Workstation.  The Server GC is optimized for scalable throughput on multiprocessor machines, the WorkStation GC is optimized to reduce collection pause times for interactive applications.

The Server GC creates a heap per processor, while the WorkStation GC creates only one heap.  When hosting multiple ASP.NET worker processes, the Server GC can consume more memory than desired, if the Workstation GC is used instead the number of hostable worker processes may increase substantially with only a small decrease in throughput.

To use the WorkStation GC:

Open the aspnet.config
(C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet.config)

Add the following within the <runtime> element:
<gcServer enabled="false"/>

This is not specific to ASP.NET 2.0, it also applies to ASP.NET 1.1

About wesmacdonald

Wes MacDonald is a Visual Studio ALM MVP, PSD, MCT and a Principal Consultant for LIKE 10 INC., a SharePoint Server, Visual Studio and Team Foundation Server Consulting Firm providing premium support and guidance services.

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: