Skip to content

fix: memory leak in run and debug view - #330233

Closed
Simon Siefke (SimonSiefke) wants to merge 1 commit into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-run-and-debug-view
Closed

Simon Siefke (SimonSiefke) wants to merge 1 commit into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-run-and-debug-view

Conversation

@SimonSiefke

Copy link
Copy Markdown
Contributor

Details

Moving Run and Debug to the panel and resetting its location leaves event listeners behind. This keeps the old Run and Debug view in memory.

Change

Dispose the progress scope, progress indicator and child instantiation service when the composite is removed.

Before

When moving the Run and Debug view to the panel and resetting its location 37 times, the view and related callbacks grow:

before

After

No more matching leak is detected.

Test Video

test-video.webm

Copilot AI balanced review requested due to automatic review settings August 11, 2026 11:43
@vs-code-engineering

Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

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

Benjamin Christopher Simmonds (@benibenj)

Matched files:

  • src/vs/workbench/browser/parts/compositePart.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 leaked Run and Debug composite resources when its view is removed.

Changes:

  • Scopes progress and instantiation resources to each composite.
  • Adds regression coverage for listener disposal.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/vs/workbench/browser/parts/compositePart.ts Disposes composite-scoped resources on removal.
src/vs/workbench/test/browser/parts/compositePart.test.ts Tests progress listener cleanup.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@dmitrivMS

Copy link
Copy Markdown
Collaborator

Simon Siefke (@SimonSiefke) Please resolve conflicts.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Conflicts

@SimonSiefke
Simon Siefke (SimonSiefke) force-pushed the fix/memory-leak-run-and-debug-view branch from ee5e279 to b127c92 Compare August 13, 2026 10:35
@dmitrivMS

Copy link
Copy Markdown
Collaborator

no changes...

@SimonSiefke

Copy link
Copy Markdown
Contributor Author

Oops, my bad. I didn't even notice it was the same changes.

@SimonSiefke
Simon Siefke (SimonSiefke) deleted the fix/memory-leak-run-and-debug-view branch August 13, 2026 12:14
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Sep 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants