Skip to content

Smaller thread stack size for copy threads#12065

Merged
SimaTian merged 1 commit intodotnet:mainfrom
Erarndt:dev/erarndt/threadSize
Jul 29, 2025
Merged

Smaller thread stack size for copy threads#12065
SimaTian merged 1 commit intodotnet:mainfrom
Erarndt:dev/erarndt/threadSize

Conversation

@Erarndt
Copy link
Contributor

@Erarndt Erarndt commented Jun 24, 2025

Context

We spawn a handful of threads to handle synchronous copying. These threads don't need the default stack size, and we can specify a smaller one to save some space for resource constrained machines.

Changes Made

Testing

Notes

Copilot AI review requested due to automatic review settings June 24, 2025 17:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR reduces the stack size for threads used in synchronous copy operations to save memory on resource-constrained machines.

  • Adjusts thread creation by specifying a 64KB stack size.
  • Adds a comment explaining the rationale for the new stack size setting.

@SimaTian SimaTian merged commit 27d132d into dotnet:main Jul 29, 2025
9 checks passed
@Erarndt Erarndt deleted the dev/erarndt/threadSize branch September 22, 2025 18:11
@JanProvaznik
Copy link
Member

I just got a report that this caused a stack overflow for the maui team in a specific scenario, should we revert?

JanProvaznik added a commit that referenced this pull request Oct 9, 2025
YuliiaKovalova pushed a commit that referenced this pull request Oct 10, 2025
Reverts #12065

internally reported stack overflow was hit for disputable benefit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants