<GCCpuGroup> 元素
指定垃圾回收是否支持多个 CPU 组。
configuration
runtime
<GCCpuGroup>
语法
<GCCpuGroup
enabled="true|false"/>
特性和元素
下列各节描述了特性、子元素和父元素。
特性
属性 | 描述 |
---|---|
enabled |
必需的特性。 指定垃圾回收是否支持多个 CPU 组。 |
enabled 特性
值 | 说明 |
---|---|
false |
垃圾回收不支持多个 CPU 组。 这是默认值。 |
true |
如果启用了服务器垃圾回收,则垃圾回收支持多个 CPU 组。 |
子元素
无。
父元素
元素 | 说明 |
---|---|
configuration |
公共语言运行时和 .NET Framework 应用程序所使用的每个配置文件中的根元素。 |
runtime |
包含有关程序集绑定和垃圾回收的信息。 |
注解
如果计算机具有多个 CPU 组并且启用了服务器垃圾回收(请参阅 <gcServer> 元素),启用此元素可以扩展所有 CPU 组的垃圾回收,并在创建和平衡堆时考虑到所有核心。
备注
此元素仅适用于垃圾回收线程。 若要使运行时能够在所有 CPU 组之间分发用户线程,还必须启用 <Thread_UseAllCpuGroups> 元素。
示例
以下示例演示如何为多个 CPU 组启用垃圾回收。
<configuration>
<runtime>
<GCCpuGroup enabled="true"/>
<gcServer enabled="true"/>
</runtime>
</configuration>
请参阅
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
.NET feedback
The .NET documentation is open source. Provide feedback here.
反馈
提交和查看相关反馈