microsoft / microsoft/terminal

Massive memory leak if left in a scrolled up position

Open
#20,342 24 comments 1 reaction 0 assignees View on GitHub
Issue-Bug Needs-Attention Needs-Triage
Dominant language
C++
Stars
105k
Forks
9.6k
Avg merge
3d 17h
Merged PRs (30d)
29

Description

### Windows Terminal version

1.24.11321.0

### Windows build number

26200.8655

### Other Software

Image

Image

Image

### Steps to reproduce

Leave a console program in a scrolled up position for an hour two whilst it continues to emit lines of output.

After a while, Windows Terminal will consume all available memory.

If you press a key to get it to scroll down, there will be a long delay and then the memory gets released and everything returns to normal.

It's just text. There is no reason it should require gigabytes of memory to hold a buffer of some text.

### Expected Behavior

No noticeable impact on memory usage. Or, if this behaviour is intentional, then put limits on it so that once memory usage exceeds a certain threshold it will automatically scroll back down to avoid rinsing the machine.

### Actual Behavior

Memory is kept allocated until scrolled back down.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the report on Windows Terminal 1.24.11321.0 with a console program continuously emitting output while the viewport remains scrolled up. The payload names no source file or test, so trace the output and scroll-buffer handling first. Done means memory remains bounded during the hour-long scenario and scrolling back down does not cause a long recovery delay.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.