Server GC in VS 2005 Beta 2?

I've recently been reading up on the garbage collector in .NET and discovered that there is a workstation version of the gc and a server version. Earlier versions of Whidbey apparently allowed the server gc to be enabled via an app.config item that looked like this...

<runtime>
<gcServer enabled=“true"/>
</runtime>
I tried this with no success, so I looked into the schema for runtime, and there is no mention of the gcServer config item. Also, I found mention of a System.Environment.IsServerGC which could be checked to see if the Server GC was being used. This doesn't exist in Beta 2 either.

Could someone please point me in the right direction? Has the Server GC been removed in Beta 2? Any insight would be greatly appreciated.

Robert Bigelow

[794 byte] By [RobertBigelow] at [2008-2-7]
# 1
Hi Robert,

I just checked and agree with your findings. There is no System.Environment.IsServerGC after Beta2. Also, running the gcServer enabled = true will surely not work.

This is because the DLL which enables this is MSCORSVR.DLL and this is not present within the C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215 folder but only the MSCORWKS.DLL which is the Workstation build of the CLR is present.

My assumption is Microsoft has not included this in the Beta version but they will include it surely for the final version.

I request someone from Microsoft to update us on this. Most of the blogs from MS people document the approach as mentioned by Robert.

Regards,
Vikram

Vikram at 2007-9-8 > top of Msdn Tech,.NET Development,Common Language Runtime...
# 2
Hi Robert

Not sure I'm understanding you correctly, but I am using VS 2005 Beta 2 on both 32 bit and 64 bit dual processor machines and server GC is working just fine. Your app config file should look like this:

<configuration>
<runtime>
<gcServer enabled="true" />
</runtime>
</configuration>

Make sure that your app config file is correctly named, e.g.:
MyApp.exe.config
and that it is in the same directory as:
MyApp.exe

Also note that server GC will only work if you have actually got a dual processor machine (although Hyperthreading should also count as two).

And finally, the property to check for whether it is enabled is:
System.Runtime.GCSettings.IsServerGC
On my machines, this property returns true with the config file, and false without it.

Vikram, it is my understanding that MSCORSVR.DLL has been merged with MSCORWKS.DLL, i.e. server GC functionality is now incorporated into MSCORWKS.DLL. So there is no MSCORSVR.DLL anymore, but the app config file method does work.

Nandor.

Nandor at 2007-9-8 > top of Msdn Tech,.NET Development,Common Language Runtime...
# 3
Thanks for the info Nandor.

Can someone from Microsoft confirm this change of MSCORSVR.dll and MSCORWKS.dll being merged into one in .NET v2.0 and provide more details?

Regards,
Vikram

Vikram at 2007-9-8 > top of Msdn Tech,.NET Development,Common Language Runtime...
# 4
Hi Vikram

Server GC does indeed exist in Whidbey Beta 2. mscorsvr.dll has been removed, and the server functionality added into mscorwks.dll.

IsServerGC has been moved to:
System.Runtime.GCSettings.IsServerGC

I have more information about Server GC on my blog:
http://blogs.msdn.com/clyon/archive/category/9863.aspx

Hope that helps!
-Chris

ChrisLyon at 2007-9-8 > top of Msdn Tech,.NET Development,Common Language Runtime...
# 5
Thanks Chris - that was very helpful.

Regards,
Vikram

Vikram at 2007-9-8 > top of Msdn Tech,.NET Development,Common Language Runtime...

.NET Development

Site Classified