You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The logic that the host has for initializing the CLR does not attempt to free stack-allocated temporary variables, causing perhaps a few hundred bytes to a few KB to remain on the stack unnecessarily. This affects every CoreCLR app whether launched from dotnet.exe or apphost (<myapp.exe>) since the stack never unwinds before running the app.
The memory could be freed by only keeping the necessary variables on the stack in each of the last frames that forward to the next late-bound location. I.e. refactor the code for example to pop up the stack frame(s) returning just the necessary state to that method (which frees any temporary stack state lower in the stack), and then calling the endpoint with just the minimum state on the stack, or perhaps use heap-allocated memory and free it before calling the next method.
Here are the three late-bound locations that can be optimized:
In the host (corehost.cpp, run()); calls hostfxr
In hostfxr.dll (fxmuxer.cpp); calls hostpolicy
In hostpolicy.dll (hostpolicy.cpp); initializes the CLR
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.
This issue will now be closed since it had been marked no-recent-activity but received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.
Activity
dotnet-policy-service commentedon Aug 25, 2024
Due to lack of recent activity, this issue has been marked as a candidate for backlog cleanup. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will undo this process.
This process is part of our issue cleanup automation.
dotnet-policy-service commentedon Sep 9, 2024
This issue will now be closed since it had been marked
no-recent-activitybut received no further activity in the past 14 days. It is still possible to reopen or comment on the issue, but please note that the issue will be locked if it remains inactive for another 30 days.