Historically, .NET has two types of garbage collectors, each of which supports a couple of different “modes”.
The first GC “flavor” is the Workstation (WKS) collector, which is designed to minimize memory usage and application pause time. The intended workload is desktop applications with user interfaces where over consumption of memory would be detrimental for end users. These applications would also be sensitive to stutters in the UI while the GC was pausing the application. These characteristics sound attractive, but come at great cost to application throughput. If you are running a medium to large server that is trying to perform serious processing, the WKS GC just isn’t going to cut it.
The second GC flavor is the Server (SVR) collector. This collector is intended to maximize overall application speed and is tuned to work best on large multi-core or many-core systems with ample memory to use. As a result, using SVR will result in larger heap sizes because it is more efficient for the GC to organize memory that way for optimal performance. SVR will also tend to use fewer, larger GC pauses because it is more efficient to wait until there is a larger amount of garbage and then clean it all up at once.
There is a sort of 3rd flavor that was recently introduced called DATAS. DATAS is a variant of the SVR GC and is intended to be more intelligent about heap size management which can lead to much smaller application heap sizes. This comes at a modest cost to application throughput. It became the default setting for application using the SVR collector in .NET9
For both WKS and SVR collectors there are four “modes” that an application can specify to tweak the behavior of the GC:
- Batch: Favor fewer, larger GC pauses to improve throughput
- Interactive: Try to balance throughput with GC pauses
- LowLatency: Try to minimize GC pauses at all costs. This can lead to decreased application throughput and increased memory fragmentation and heap size. Not intended to be used for long stretches of time. (Not supported for SVR)
- SustainedLowLatency: A newer mode that tries to minimize GC pauses while keeping memory fragmentation and heap size under control.
Satori, the new GC flavor, supports only Interactive and
LowLatency modes, but offers very different performance characteristics
compared to the existing GC flavors that would appear to make it a great hybrid
solution between the existing SVR and WKS GCs.