views:

180

answers:

2

A co-worker said this is possible (but it looks a bit strange to me).
If there's a way to do it, where can I do this?
I'm talking about winXP OS.

A: 

Don't do it. I profiled it, and even on 3.5 it got significantly worse (where the CLR 4 has an even more awesome GC).

280Z28
What exactly did you profile? (just curious)
Henk Holterman
At the time I was profiling a compiler - the lexer/parser was causing some issues allocating tens of millions of objects in rapid succession.
280Z28
But what did you do regarding the GC?
Henk Holterman
+7  A: 

Yes, the GC has two modes of operation: Server and Workstation. You can change modes in either your app.config (per application) or machine.config. See http://blogs.msdn.com/junfeng/archive/2004/07/13/181534.aspx for more information.

<Configuration>
    <runtime>
        <gcServer enabled="false" />
        <gcConcurrent enabled="true" />
    </runtime>
</Configuration>

For gcServer:

  • false - Does not run server garbage collection. This is the default.
  • true - Runs server garbage collection.

For gcConcurrent:

  • false - Does not run garbage collection concurrently.
  • true - Runs garbage collection concurrently. This is the default.

In general, however, you don't want to change the GC operation mode, especially on a machine level unless you have a really, really good reason to. Generally the only things that care about this are unmanaged applications that are hosting the CLR themselves (such as SQL Server or IIS).

Scott Dorman
Don't forget gcConcurrent, though not really a mode, it is (can be) a machine wide config to the GC
Marc
Thanks. I had forgotten about that one.
Scott Dorman
Tess Fernandez has a great article that includes details on the different GC modes -> http://blogs.msdn.com/tess/archive/2008/04/17/how-does-the-gc-work-and-what-are-the-sizes-of-the-different-generations.aspx
adrianbanks
@adrianbanks: Great link. Thanks!
Scott Dorman
Thank you all! - @Scott @Marc @adrianbanks
Ohad Horesh