How to determine what is the current Gabarge Collector mode in .NET 4?

.net, .net-4.0, garbage-collection

Solution

Niranjan's answer includes more relevant details, but I believe the answer to your actual question is `System.Runtime.GCSettings`.

It includes the properties:

- `IsServerGC` - Indicates whether server garbage collection is enabled.

- `LatencyMode` - Indicates the current latency mode for garbage collection.

Problem

The .NET Garbage Collector has a couple of modes. I'd like to know what is the default mode for a Windows Server SKU. How to determine what is the current Gabarge Collector mode in .NET 4?

Original source