There's a resource leak somewhere in the App/Control/Connection stack #1023

Closed
opened 2026-01-30 22:14:06 +00:00 by claunia · 7 comments
Owner

Originally created by @Kirbk on GitHub (May 13, 2019).

When closing a tab, the memory that was allocated for the tab is retained. This leads to a massive memory leak when the application is used continuously, opening and closing tabs like users do. This uses gigabytes of RAM, the only way to clear it is to close out of the terminal completely and relaunch it.

Originally created by @Kirbk on GitHub (May 13, 2019). When closing a tab, the memory that was allocated for the tab is retained. This leads to a massive memory leak when the application is used continuously, opening and closing tabs like users do. This uses gigabytes of RAM, the only way to clear it is to close out of the terminal completely and relaunch it.
Author
Owner

@onekopaka commented on GitHub (May 14, 2019):

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.

@onekopaka commented on GitHub (May 14, 2019): 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.
Author
Owner

@onekopaka commented on GitHub (May 14, 2019):

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.

@onekopaka commented on GitHub (May 14, 2019): 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.
Author
Owner

@zadjii-msft commented on GitHub (May 14, 2019):

@onekopaka I moved your bug report to 768, to try and keep this thread specific to the cleanup of the TermControl's when a tab is closed

@zadjii-msft commented on GitHub (May 14, 2019): @onekopaka I moved your bug report to 768, to try and keep this thread specific to the cleanup of the TermControl's when a tab is closed
Author
Owner

@dreamer-dead commented on GitHub (May 22, 2019):

Is it possible to reproduce this leak after #914 was merged into master?
I can't check that by myself =(

@dreamer-dead commented on GitHub (May 22, 2019): Is it possible to reproduce this leak after #914 was merged into `master`? I can't check that by myself =(
Author
Owner

@Kirbk commented on GitHub (May 24, 2019):

@dreamer-dead I just rechecked and it still appears to still be present in the most recent merge.

@Kirbk commented on GitHub (May 24, 2019): @dreamer-dead I just rechecked and it still appears to still be present in the most recent merge.
Author
Owner

@driver1998 commented on GitHub (May 30, 2019):

I guess when the tab closes, it doesn't end the conhost process attached to it.

What I did:
Start Windows Terminal, open 9 powershell tabs, and close 8 of them.
Result:
批注 2019-05-30 123646

@driver1998 commented on GitHub (May 30, 2019): I guess when the tab closes, it doesn't end the conhost process attached to it. What I did: Start Windows Terminal, open 9 powershell tabs, and close 8 of them. Result: ![批注 2019-05-30 123646](https://user-images.githubusercontent.com/22699485/58608751-a0458180-82d7-11e9-9d30-e5d330c6082b.png)
Author
Owner

@zadjii-msft commented on GitHub (Jun 10, 2019):

Somehow, I fixed this in #825. Hooray!

@zadjii-msft commented on GitHub (Jun 10, 2019): Somehow, I fixed this in #825. Hooray!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#1023