Skip to content

fix: memory leak in extensions view - #330210

Merged
Benjamin Christopher Simmonds (benibenj) merged 1 commit into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-extensions-view
Aug 13, 2026
Merged

Benjamin Christopher Simmonds (benibenj) merged 1 commit into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-extensions-view

Conversation

@SimonSiefke

Copy link
Copy Markdown
Contributor

Details

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

Change

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

Before

When moving the Extensions view to the panel and resetting its location 37 times, the pane composite, Extensions view state, 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 09:59
@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 lifecycle leaks when Extensions composites are removed or relocated.

Changes:

  • Associates progress and child-instantiation resources with each composite.
  • Adds regression coverage for progress-scope 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 listener cleanup after removal.

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

Comment on lines +189 to +191
const disposable = new DisposableStore();
const that = this;
const compositeProgressIndicator = new ScopedProgressIndicator(assertReturnsDefined(this.progressBar), this._register(new class extends AbstractProgressScope {
const compositeProgressIndicator = disposable.add(new ScopedProgressIndicator(assertReturnsDefined(this.progressBar), disposable.add(new class extends AbstractProgressScope {
@SimonSiefke

Copy link
Copy Markdown
Contributor Author

@dmitrivMS

Copy link
Copy Markdown
Collaborator

Simon Siefke (@SimonSiefke) Thank you!

@benibenj
Benjamin Christopher Simmonds (benibenj) merged commit 69e469f into microsoft:main Aug 13, 2026
27 of 28 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.134.0 milestone Aug 13, 2026
@SimonSiefke
Simon Siefke (SimonSiefke) deleted the fix/memory-leak-extensions-view branch August 13, 2026 20: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.

5 participants