Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate memory leak over time #768

Closed
zadjii-msft opened this issue May 14, 2019 · 2 comments · Fixed by #1063
Closed

Investigate memory leak over time #768

zadjii-msft opened this issue May 14, 2019 · 2 comments · Fixed by #1063
Labels
Area-TerminalConnection Issues pertaining to the terminal<->backend connection interface Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal.
Milestone

Comments

@zadjii-msft
Copy link
Member

zadjii-msft commented May 14, 2019

From discussion in #745

I do not have very concrete data on it yet, but I also see a massive memory leak in WindowsTerminal.exe, even with only ever having just one tab open.
I tend to see this memory consumption happen most aggressively with any sort of application that continuously updates the screen like mtr or htop (I'm using the version of OpenSSH bundled with Windows build 18362 to connect to a Linux machine to run these). A session that run for just under 40 minutes got up to over 1000 MB of memory usage according to Task Manager.

Another bit of information, all that memory seems to be released over time, that same session, now sitting at a shell over SSH calms down and now roughly 3 hours later, it is using an efficient and trim 8.5 MB of RAM according to Task Manager.

@zadjii-msft zadjii-msft added Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Area-TerminalConnection Issues pertaining to the terminal<->backend connection interface Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) labels May 14, 2019
@zadjii-msft zadjii-msft added this to the Windows Terminal v1.0 milestone May 14, 2019
@ghost ghost added the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@miniksa miniksa added Product-Terminal The new Windows Terminal. and removed Mass-Chaos labels May 17, 2019
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label May 17, 2019
@Robo210
Copy link
Contributor

Robo210 commented May 29, 2019

It looks like at least one stack that's doing constant allocations is

Commit Stack Size (MB)
[Root] 3.609
ntdll.dll!RtlUserThreadStart 3.609
kernel32.dll!BaseThreadInitThunk 3.609
TerminalControl.dll!Microsoft::Console::Render::RenderThread::s_ThreadProc 3.609
TerminalControl.dll!Microsoft::Console::Render::Renderer::PaintFrame 3.609
TerminalControl.dll!Microsoft::Console::Render::Renderer::_PaintFrameForEngine 3.609
TerminalControl.dll!Microsoft::Console::Render::Renderer::_PaintBufferOutput 3.609
TerminalControl.dll!Microsoft::Console::Render::Renderer::_PaintBufferOutputHelper 3.609
TerminalControl.dll!Microsoft::Console::Render::DxEngine::PaintBufferLine 3.609
TerminalControl.dll!Microsoft::Console::Render::CustomTextLayout::_AnalyzeRuns 3.609
|- TerminalControl.dll!Microsoft::Console::Render::CustomTextLayout::_AnalyzeFontFallback 3.133
|    DWrite.dll!DWriteFontFallback::MapCharacters 3.133
|    DWrite.dll!FontFallback::MapCharacters 3.133
|    |- DWrite.dll!MatchFamilyToText 1.641
|    |- DWrite.dll!GetFontFamily 1.492

This came from 10 seconds of tracing while a progress bar was being printed to the console.

Robo210 added a commit to Robo210/terminal that referenced this issue May 30, 2019
@Biswa96
Copy link

Biswa96 commented May 30, 2019

How did you find?

@ghost ghost closed this as completed in #1063 May 30, 2019
ghost pushed a commit that referenced this issue May 30, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-TerminalConnection Issues pertaining to the terminal<->backend connection interface Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants