Two kind of Garbage Collector
19/01/2010 Leave a comment
when working on client machine you can use server type garbage collector.But it uses more memory.By default in server OS uses Server type garbage collector. You can configure in your web config like
<configuration>
<runtime>
<gcServer enabled="true"/>
</runtime>
</configuration>
The CLR has two different GCs: Workstation (mscorwks.dll) and Server (mscorsvr.dll). When running in Workstation mode, latency is more of a concern than space or efficiency. A server with multiple processors and clients connected over a network can afford some latency, but throughput is now a top priority. Rather than shoehorn both of these scenarios into a single GC scheme, Microsoft has included two garbage collectors that are tailored to each situation.
Server GC:
- Multiprocessor (MP) Scalable, Parallel
- One GC thread per CPU
- Program paused during marking
Workstation GC:
- Minimizes pauses by running concurrently during full collections
The server GC is designed for maximum throughput, and scales with very high performance. Memory fragmentation on servers is a much more severe problem than on workstations, making garbage collection an attractive proposition. In a uniprocessor scenario, both collectors work the same way: workstation mode, without concurrent collection. On an MP machine, the Workstation GC uses the second processor to run the collection concurrently, minimizing delays while diminishing throughput. The Server GC uses multiple heaps and collection threads to maximize throughput and scale better.
Source: MSDN