Conversation
|
|
||
| - The default size of stack is dictated by VM and OS policies. | ||
| - This setting allows overriding the default. | ||
| - The specified size should be between 64 kB and 2 GB and a multiple of the natural allocation granularity of the OS. |
There was a problem hiding this comment.
a multiple of the natural allocation granularity of the OS
Can we align the size up in the implementation so that this does not need to be documented? I think it is only a problem on Windows. This should behave just like the stackSize argument for System.Threading.Thread constructor where we do the same.
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
Co-authored-by: Genevieve Warren <24882762+gewarren@users.noreply.github.com>
PoliCheck Scan ReportThe following report lists PoliCheck issues in PR files. Before you merge the PR, you must fix all severity-1 issues. Other issues are also a high priority. The AI Review Details column lists suggestions for either removing or replacing the terms. If you find a false positive result, mention it in a PR comment and include this text: #policheck-false-positive. This feedback helps reduce false positives in future scans. ✅ No issues foundMore information about PoliCheckInformation: PoliCheck | Severity Guidance | Term |
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
There was a problem hiding this comment.
Pull request overview
Adds documentation for a new .NET 10 runtime configuration option that controls the default stack size for threads created by the .NET runtime, expanding the existing threading runtime-config reference.
Changes:
- Documented a new “DefaultStackSize” threading configuration setting.
- Added a new section describing default behavior, constraints, and configuration surfaces (runtimeconfig.json + environment variable).
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
|
||
| | | 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 | |
There was a problem hiding this comment.
is it really decimal here but hex for the env var? that seems quite confusing
There was a problem hiding this comment.
Yep, the COMPlus_/DOTNET_ variables have been hex for 25+ years. And yep, people expect decimal most of the time and we had bugs around that even in our products.
See e.g. the GC settings: https://learn.microsoft.com/en-us/dotnet/core/runtime-config/garbage-collector#ways-to-specify-the-configuration
Added in dotnet/runtime#110455.
Internal previews