Show / Hide Table of Contents

Class GcModeExtensions

Inheritance
Object
GcModeExtensions
Namespace: BenchmarkDotNet.Jobs
Assembly: BenchmarkDotNet.dll
Syntax
public static class GcModeExtensions

Methods

WithAllowVeryLargeObjects(GcMode, Boolean)

On 64-bit platforms, enables arrays that are greater than 2 gigabytes (GB) in total size. false: Arrays greater than 2 GB in total size are not enabled. This is the default. true: Arrays greater than 2 GB in total size are enabled on 64-bit platforms.

Declaration
public static GcMode WithAllowVeryLargeObjects(this GcMode mode, bool value)
Parameters
Type Name Description
GcMode mode
Boolean value
Returns
Type Description
GcMode

WithConcurrent(GcMode, Boolean)

Specifies whether the common language runtime runs garbage collection on a separate thread. false: Does not run garbage collection concurrently. true: Runs garbage collection concurrently. This is the default.

Declaration
public static GcMode WithConcurrent(this GcMode mode, bool value)
Parameters
Type Name Description
GcMode mode
Boolean value
Returns
Type Description
GcMode

WithCpuGroups(GcMode, Boolean)

Specifies whether garbage collection supports multiple CPU groups. false: Garbage collection does not support multiple CPU groups. This is the default. true: Garbage collection supports multiple CPU groups, if server garbage collection is enabled.

Declaration
public static GcMode WithCpuGroups(this GcMode mode, bool value)
Parameters
Type Name Description
GcMode mode
Boolean value
Returns
Type Description
GcMode

WithForce(GcMode, Boolean)

Specifies whether the BenchmarkDotNet's benchmark runner forces full garbage collection after each benchmark invocation false: Does not force garbage collection. true: Forces full garbage collection after each benchmark invocation. This is the default.

Declaration
public static GcMode WithForce(this GcMode mode, bool value)
Parameters
Type Name Description
GcMode mode
Boolean value
Returns
Type Description
GcMode

WithHeapAffinitizeMask(GcMode, Int32)

process mask, see MSDN for more.

Declaration
public static GcMode WithHeapAffinitizeMask(this GcMode mode, int heapAffinitizeMask)
Parameters
Type Name Description
GcMode mode
Int32 heapAffinitizeMask
Returns
Type Description
GcMode

WithHeapCount(GcMode, Int32)

specify the # of Server GC threads/heaps, must be smaller than the # of logical CPUs the process is allowed to run on, ie, if you don't specifically affinitize your process it means the # of total logical CPUs on the machine; otherwise this is the # of logical CPUs you affinitized your process to.

Declaration
public static GcMode WithHeapCount(this GcMode mode, int heapCount)
Parameters
Type Name Description
GcMode mode
Int32 heapCount
Returns
Type Description
GcMode

WithNoAffinitize(GcMode, Boolean)

specify true to disable hard affinity of Server GC threads to CPUs

Declaration
public static GcMode WithNoAffinitize(this GcMode mode, bool value)
Parameters
Type Name Description
GcMode mode
Boolean value
Returns
Type Description
GcMode

WithRetainVm(GcMode, Boolean)

Put segments that should be deleted on a standby list for future use instead of releasing them back to the OS The default is false

Declaration
public static GcMode WithRetainVm(this GcMode mode, bool value)
Parameters
Type Name Description
GcMode mode
Boolean value
Returns
Type Description
GcMode

WithServer(GcMode, Boolean)

Specifies whether the common language runtime runs server garbage collection. false: Does not run server garbage collection. This is the default. true: Runs server garbage collection.

Declaration
public static GcMode WithServer(this GcMode mode, bool value)
Parameters
Type Name Description
GcMode mode
Boolean value
Returns
Type Description
GcMode
In This Article
Back to top Copyright © 2013–2021 .NET Foundation and contributors