Conversation
Member
Author
|
I would like to prevent commit completely if all we do is render an empty console window, which should save roughly 40kb for every console application ever spawned until it prints its first text. But given our architecture that may not currently be feasible. |
This comment has been minimized.
This comment has been minimized.
c685c30 to
72680af
Compare
This comment has been minimized.
This comment has been minimized.
We have been looking at a set of conhost crashes due to low-memory conditions. I've observed that they all happen during the first pass of rendering, before there's even an engine set up, when we try to estimate whether there are any blink attributes. I also found that we'll commit the buffer to check the cursor's double-width status and whether it's on a double-width-rendition line. We can't necessarily avoid committing an empty buffer _forever,_ but this at least moves the first commit until after the renderer truly starts. Whether that's good or not remains to be seen.
72680af to
e1c43fe
Compare
lhecker
approved these changes
Mar 18, 2026
Member
lhecker
left a comment
There was a problem hiding this comment.
If we did buffer snapshotting this may be relatively easy to implement by copying uncommitted rows as whitespace.
DHowett
added a commit
that referenced
this pull request
Mar 18, 2026
This saves us all of the cost of preparing the renderer when we're not going to use it. Related to #19984
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We have been looking at a set of conhost crashes due to low-memory conditions. I've observed that they all happen during the first pass of rendering, before there's even an engine set up, when we try to estimate whether there are any blink attributes. I also found that we'll commit the buffer to check the cursor's double-width status and whether it's on a double-width-rendition line.
Uncommitted rows never contain a blinker, are never double-width and never contain DBCS.
We can't necessarily avoid committing an empty buffer forever, but this at least moves the first commit until after the renderer truly starts.
This prevents us from committing an empty buffer for headless console apps (!)