问题
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.
回答1:
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).
来源:https://stackoverflow.com/questions/1267611/net-is-there-a-way-to-change-the-gc-behavior-for-the-entire-machine