8779249b12
The `_CONSOLE_API_MSG` buffer is resized to cover an entire message. Later on any UTF-8 data is cached in a separate temporary buffer inside `til::u8state` to prevent lone surrogate pairs. Both cases are problematic as neither buffer is freed after the read has finished. Passing a 100MB buffer to conhost once will thus cause it to continue using ~220MB of physical memory until the conhost process exits. This change releases unneeded memory as soon as the requested buffer size has halved. In practice this means that once a command has returned all buffers will shrink, as the shell commonly sends very small messages. ## PR Checklist * [x] Closes #10731 * [x] I work here * [x] Tests added/passed ## Validation Steps Performed * Buffers aren't reallocated during printing ✔️ * Buffers shrink after printing finished ✔️ |
||
---|---|---|
.. | ||
CppCoreCheck | ||
test | ||
til | ||
argb.h | ||
conattrs.hpp | ||
conime.h | ||
conint.h | ||
conpty-static.h | ||
conpty.h | ||
consoletaeftemplates.hpp | ||
contsf.h | ||
cpl_core.h | ||
DefaultSettings.h | ||
HostAndPropsheetIncludes.h | ||
HostSignals.hpp | ||
ITerminalOutputConnection.hpp | ||
ITerminalOwner.hpp | ||
LibraryIncludes.h | ||
operators.hpp | ||
til.h | ||
unicode.hpp | ||
VtIoModes.hpp | ||
WilErrorReporting.h | ||
winrtTaefTemplates.hpp |