JosephCooney

Putting the 'Junk' in DotNetJunkies

<November 2008>
SuMoTuWeThFrSa
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456


Navigation

My GotDotNet Samples

Subscriptions

News

I've moved my weblog to jcooney.net. Come and visit me there.


Garbage Collector Deathmatch - "There can be only one"

I was talking to “Biztalk” Bill Chesnut today about Garbage Collection. I was vaguely aware that there were actually 2 garbage collectors in .NET 1.x, one optimized for workstations and another for servers (mscorwks.dll and mscorsvr.dll respectively). It seems that in .NET 2.0 mscorsvr.dll has been absorbed into mscorwks.dll which has doubled in size, and it is/will be possible to select which version of GC you want via app.config. Server GC partitions the managed heap out into a number of sections (1 for each CPU), and when a collection is initiated the garbage collector gets one thread per CPU. Server GC suspends CLR threads during GC, while workstation GC performs GC in parallel with CLR threads. Presumably this is so that smart-client applications don't “lock” while GC is happening.

K. Scott Allen has some interesting info on this also with respect to some .NET framework 1.0 settings that SOUND like they do what is coming in framework 2.0, but actually don't.

Update: in the comments William Luu points to these two very applicable posts from Chris Lyon [1,2] (and sorry to Chris for spelling his fairly straightforward second name wrong).

Update 2:It seems that there aren't just 2 flavours of GC but three - Server GC and two workstation flavours, one with concurrent GC ON and another with it OFF. More info here: http://blogs.msdn.com/maoni/archive/2004/09/25/234273.aspx

posted on Monday, September 13, 2004 2:57 AM by JosephCooney





Powered by Dot Net Junkies, by Telligent Systems