<UseSmallInternalThreadStacks > 元素<UseSmallInternalThreadStacks> Element

要求 common language runtime (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> <configuration>
    <runtime >   <runtime>
     <UseSmallInternalThreadStacks >    <UseSmallInternalThreadStacks>

語法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 Attribute

Value 描述Description
truetrue 要求明確堆疊大小。Request explicit stack sizes.
Falsefalse 使用預設堆疊大小。Use the default stack size. 這是 .NET Framework 4 的預設值。This is the default for the .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 中,要求僅適用于 x86 架構。In the .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