<UseSmallInternalThreadStacks > 元素<UseSmallInternalThreadStacks> Element

请求公共语言运行时 (CLR),减少内存使用通过指定显式堆栈大小,当它创建的某些线程,它在内部使用,而不是使用这些线程的默认堆栈大小。Requests that the common language runtime (CLR) reduce memory use by specifying explicit stack sizes when it creates certain threads that it uses internally, instead of using the default stack size for those threads.

<配置 > 元素<configuration> Element
<运行时 > 元素<runtime> Element
<UseSmallInternalThreadStacks > 元素<UseSmallInternalThreadStacks> Element

语法Syntax

<UseSmallInternalThreadStacks enabled="true|false" />  

特性和元素Attributes and Elements

下列各节描述了特性、子元素和父元素。The following sections describe attributes, child elements, and parent elements.

特性Attributes

特性Attribute 描述Description
enabledenabled 必需的特性。Required attribute.

指定是否要求,CLR 使用显式堆栈大小,而不是默认堆栈大小时创建的某些线程,它在内部使用。Specifies whether to request that the CLR use explicit stack sizes instead of the default stack size when it creates certain threads that it uses internally. 显式堆栈大小都小于 1 MB 的默认堆栈大小。The explicit stack sizes are smaller than the default stack size of 1 MB.

enabled 特性enabled Attribute

“值”Value 描述Description
truetrue 请求显式堆栈大小。Request explicit stack sizes.
Falsefalse 使用默认堆栈大小。Use the default stack size. 这是默认.NET Framework 4.NET Framework 4This is the default for the .NET Framework 4.NET Framework 4.

子元素Child Elements

无。None.

父元素Parent Elements

元素Element 描述Description
configuration 公共语言运行时和 .NET Framework 应用程序所使用的每个配置文件中的根元素。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.

备注Remarks

此配置元素用于请求降低了的虚拟内存使用在进程中,因为 CLR 如果接受请求,对其内部线程,使用显式线程大小小于默认大小。This configuration element is used to request reduced virtual memory use in a process, because the explicit thread sizes that the CLR uses for its internal threads, if the request is honored, are smaller than the default size.

重要

此配置元素是对 CLR,而不是绝对要求的请求。This configuration element is a request to the CLR rather than an absolute requirement. .NET Framework 4.NET Framework 4,则请求响应仅针对 x86 体系结构。In the .NET Framework 4.NET Framework 4, the request is honored only for the x86 architecture. 此元素可能会在 CLR 的未来版本中完全忽略或替换为显式堆栈大小始终用于所选的内部线程。This element might be ignored completely in future versions of the CLR, or replaced by explicit stack sizes that are always used for selected internal threads.

指定此配置元素交易的可靠性较小的虚拟内存使用 CLR 允许该请求,但是否因为较小的堆栈大小可能会使堆栈更有可能溢出。Specifying this configuration element trades reliability for smaller virtual memory use if the CLR honors the request, because smaller stack sizes could potentially make stack overflows more likely.

示例Example

下面的示例演示如何请求 CLR 使用显式堆栈调整某些大小在内部使用的线程。The following example shows how to request that the CLR use explicit stack sizes for certain threads that it uses internally.

<configuration>  
   <runtime>  
      <UseSmallInternalThreadStacks enabled="true" />  
   </runtime>  
</configuration>  

请参阅See also