Skip to content

fix: memory leak in PerfModelContentProvider - #328581

Merged
Connor Peet (connor4312) merged 1 commit into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-PerfModelContentProvider
Aug 3, 2026
Merged

fix: memory leak in PerfModelContentProvider#328581
Connor Peet (connor4312) merged 1 commit into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-PerfModelContentProvider

Conversation

@SimonSiefke

Copy link
Copy Markdown
Contributor

Details

When the Startup Performance text model is recreated, disposed language and extension-status listeners stay reachable because _modelDisposables keeps their disposable wrappers.

Change

Use the empty array returned by dispose so only listeners for the current model remain reachable.

Before

When running startup-performance-view-open 37 times, the language selection and content-provider callbacks grow:

startup-performance-view-open before

After

No more matching leak is detected.

Test Video

startup-performance-view-open.webm

Copilot AI review requested due to automatic review settings August 1, 2026 20:17

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 retained disposable wrappers when the Startup Performance model is recreated.

Changes:

  • Reassigns _modelDisposables to dispose()’s empty-array result.
  • Adds regression coverage for repeated model creation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
perfviewEditor.ts Clears disposed model listeners.
perfviewEditor.test.ts Verifies listener storage remains bounded.

@connor4312 Connor Peet (connor4312) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

thanks!

@connor4312
Connor Peet (connor4312) merged commit 05ab6d1 into microsoft:main Aug 3, 2026
29 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.133.0 milestone Aug 3, 2026
@SimonSiefke
Simon Siefke (SimonSiefke) deleted the fix/memory-leak-PerfModelContentProvider branch August 13, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants