Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix: memory leak in decorationAddon._decorations - #326933

Merged
Dmitriy Vasyura (dmitrivMS) merged 3 commits into
microsoft:mainfrom
SimonSiefke:fix/terminal-decoration-marker-memory-leak
Jul 31, 2026
Merged

fix: memory leak in decorationAddon._decorations#326933
Dmitriy Vasyura (dmitrivMS) merged 3 commits into
microsoft:mainfrom
SimonSiefke:fix/terminal-decoration-marker-memory-leak

Conversation

@SimonSiefke

Copy link
Copy Markdown
Contributor

Details

Disposes terminal decoration hover and context menu resources with their marker.

Before

When running the same task 37 times, terminal decoration callbacks grow each time (outlined in red):

task-run-fix-terminal-decoration-marker-memory-leak-before

After

No more leak is detected for these callbacks.

task-run-fix-terminal-decoration-marker-memory-leak-after

Copilot AI review requested due to automatic review settings July 22, 2026 09:18
@vs-code-engineering

vs-code-engineering Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

Anthony Kim (@anthonykim1)

Matched files:

  • src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts
  • src/vs/workbench/contrib/terminal/test/browser/xterm/decorationAddon.test.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes terminal decoration resource leaks by cleaning up hover and context-menu disposables when their xterm decoration is disposed.

Changes:

  • Disposes decoration-scoped resources during decoration teardown.
  • Removes disposed decorations from the tracking map.

Comment thread src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) enabled auto-merge (squash) July 31, 2026 00:17
@dmitrivMS

Copy link
Copy Markdown
Collaborator

Simon Siefke (@SimonSiefke) Thank you!

@anthonykim1 Anthony Kim (anthonykim1) added this to the 1.132.0 milestone Jul 31, 2026
@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit c886f58 into microsoft:main Jul 31, 2026
29 checks passed
@SimonSiefke
Simon Siefke (SimonSiefke) deleted the fix/terminal-decoration-marker-memory-leak branch August 13, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants