Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

<gcConcurrent> Element

Specifies whether the common language runtime runs garbage collection on a separate thread.

<configuration> Element
  <runtime> Element
    <gcConcurrent> Element
<gcConcurrent  
   enabled="true|false"/>

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute

Description

enabled

Required attribute.

Specifies whether the runtime runs garbage collection concurrently.

enabled Attribute

Value

Description

false

Does not run garbage collection concurrently.

true

Runs garbage collection concurrently. This is the default.

Child Elements

None.

Parent Elements

Element

Description

configuration

The root element in every configuration file used by the common language runtime and .NET Framework applications.

runtime

Contains information about assembly binding and garbage collection.

The setting in the machine configuration file is the default for all .NET Framework applications. The machine configuration file setting overrides the application configuration file setting.

By default, the runtime uses concurrent garbage collection, which is optimized for latency. If you set the enabled attribute of the <gcConcurrent> element to false, the runtime uses non-concurrent garbage collection, which is optimized for throughput.

If your application involves heavy user interaction, leave concurrent garbage collection enabled to minimize the application's pause time to perform garbage collection.

Caution noteCaution

Starting with the .NET Framework 4, concurrent garbage collection is replaced by background garbage collection. The terms concurrent and background are used interchangeably in the .NET Framework documentation. To disable background garbage collection, use the <gcConcurrent> element, as discussed in this article.

The following example shows how to disable concurrent garbage collection.

<configuration>
   <runtime>
      <gcConcurrent enabled="false"/>
   </runtime>
</configuration>
Show:
© 2014 Microsoft. All rights reserved.