Open matprec opened 5 years ago
I can see if I can reproduce this on macOS or not — I bet it would be helpful to know if this is a Windows-specific issue?
That would be extremely useful! Though i'll get back to this in a few weeks, this is not urgent atm
This does not happen with wsl
This indicates that cmd/powershell themself have internal problems, or that tui
or an underlying library handle something unproperly on windows
https://github.com/TimonPost/crossterm/issues/195 is probably the culprit. Because of the early returns i initially just wrapped it in a loop and forgot about it.
Combined, this results in a busy looping over the console input count. This explains the cpu usage. I'm not sure what causes the unreasonable memory growth in the console subsystem underneath, but for now i'd be happy if it just goes away. We should keep this in mind, in case other memory issues surface.
Since the memory usage comes down to busy looping over the console input, pathological amounts of inputs or extremely long sessions could trigger this again.
On windows, the memory usage in the underlying console subsystem grows unproportionally fast, ~3.5-4Mb per second, while the console itself stays within 0.1-0.2% of the usage.