Slow memory leak in Windows Terminal #19107

Open
opened 2026-01-31 06:34:00 +00:00 by claunia · 0 comments
Owner

Originally created by @Treit on GitHub (Dec 21, 2022).

Originally assigned to: @lhecker on GitHub.

Windows Terminal version

1.16.3464.0

Windows build number

10.0.25272.0

Other Software

There appears to be a slow memory leak in Windows Terminal.

I was running my small Terminal Stress app that I have used to find other bugs in the past. I accidentally left it running overnight and when I came in the next morning I found WindowsTerminal was consuming a large amount of memory.

This appears to be reproducible by simply running the Terminal Stress app (a simple .NET console application) and letting it run.

Steps to reproduce

  1. Build Terminal Stress and run it from a terminal window.

  2. Let it run for a long time.

  3. Observe that the memory usage for Windows Terminal climbs slowly.

  4. Eventually stop the program from running.

  5. Note that the memory usage (commit size) remains high.

Expected Behavior

Memory usage should remain relatively flat as the test program simply prints random characters to random positions on the screen.

Actual Behavior

The memory increases, quite slowly but surely.

In my most recent case I found the memory usage was more than 3GB after the stress program had run for about 20 hours.

Originally created by @Treit on GitHub (Dec 21, 2022). Originally assigned to: @lhecker on GitHub. ### Windows Terminal version 1.16.3464.0 ### Windows build number 10.0.25272.0 ### Other Software There appears to be a slow memory leak in Windows Terminal. I was running my small [Terminal Stress](https://github.com/Treit/TerminalStress) app that I have used to find other bugs in the past. I accidentally left it running overnight and when I came in the next morning I found WindowsTerminal was consuming a large amount of memory. This appears to be reproducible by simply running the Terminal Stress app (a simple .NET console application) and letting it run. ### Steps to reproduce 1. Build [Terminal Stress](https://github.com/Treit/TerminalStress) and run it from a terminal window. 2. Let it run for a long time. 3. Observe that the memory usage for Windows Terminal climbs slowly. 4. Eventually stop the program from running. 5. Note that the memory usage (commit size) remains high. ### Expected Behavior Memory usage should remain relatively flat as the test program simply prints random characters to random positions on the screen. ### Actual Behavior The memory increases, quite slowly but surely. In my most recent case I found the memory usage was more than 3GB after the stress program had run for about 20 hours.
claunia added the Area-OutputIssue-BugNeeds-Tag-FixProduct-Terminal labels 2026-01-31 06:34:00 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#19107