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 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