diff --git a/docs/core/runtime-config/threading.md b/docs/core/runtime-config/threading.md index b2806433ca0a2..9906b5d726d3c 100644 --- a/docs/core/runtime-config/threading.md +++ b/docs/core/runtime-config/threading.md @@ -31,6 +31,17 @@ This article details the settings you can use to configure threading in .NET. | **runtimeconfig.json** | N/A | N/A | | **Environment variable** | `COMPlus_Thread_AssignCpuGroups` or `DOTNET_Thread_AssignCpuGroups` | `0` - disabled
`1` - enabled | +## Set the stack size for threads created by the .NET runtime + +- The default stack size is dictated by .NET and OS policies. The default stack size for .NET apps is 1.5 MB on Windows and macOS, and 8 MB on Linux. The default stack size when the .NET runtime is hosted (for example, COM components) is dictated by the hosting process. +- This setting allows overriding the default for threads created by the .NET runtime. For example, threads created by the API. +- The specified size should be between 64 KB and 2 GB. + +| | Setting name | Values | Version introduced | +| - | - | - | - | +| **runtimeconfig.json** | `System.Threading.DefaultStackSize` | A decimal integer that specifies the stack size, in bytes, for threads created by the .NET runtime | .NET 10 | +| **Environment variable** | `DOTNET_Thread_DefaultStackSize` | A hexadecimal integer that specifies the stack size, in bytes, for threads created by the .NET runtime | .NET 10 | + ## Minimum threads - Specifies the minimum number of threads for the worker thread pool.