Skip to content

fix: memory leak in debug visualization registrations - #340046

Merged
Dmitriy Vasyura (dmitrivMS) merged 5 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-debugVisualization-registrations
Oct 6, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 5 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-debugVisualization-registrations

Conversation

@SimonSiefke

Copy link
Copy Markdown
Contributor

Details

Debug visualization providers are registered under a key containing the extension ID and provider ID. Disposal deletes only the provider ID, so the old registrations are never removed.

Change

Use the same extension-qualified key for registration and disposal.

Before

When registering and disposing a debug visualization provider 37 times, 37 old providers remain in the extension host:

debug-vis-before

After

No more disposed debug visualization providers remain in the same 37-cycle test.

Test Video

debug-vis-desktop-video.webm

AI disclosure: Model: GPT 6 Astra. Worktime: unknown

Copilot AI balanced review requested due to automatic review settings October 6, 2026 12:57

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.

Copilot review overview

🟢 Approval recommended

The focused key corrections are correct and covered by regression tests.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes leaked extension-host debug visualization registrations by consistently using extension-qualified keys.

Changes:

  • Corrects provider and tree-provider disposal keys.
  • Adds regression tests for disposal and re-registration.
File Description
src/​vs/​workbench/​api/​common/​extHostDebugService.ts Deletes registrations using their stored extension-qualified keys.
src/​vs/​workbench/​api/​test/​browser/​extHostDebugVisualization.test.ts Tests provider cleanup and re-registration behavior.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@dmitrivMS Dmitriy Vasyura (dmitrivMS) added debug Debug viewlet, configurations, breakpoints, adapter issues freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues and removed triage-needed labels Oct 6, 2026
@dmitrivMS

Copy link
Copy Markdown
Collaborator

Simon Siefke (@SimonSiefke) Thank you!

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit 6ca7758 into microsoft:main Oct 6, 2026
55 of 56 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.142.0 milestone Oct 6, 2026
@SimonSiefke
Simon Siefke (SimonSiefke) deleted the fix/memory-leak-debugVisualization-registrations branch October 13, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debug Debug viewlet, configurations, breakpoints, adapter issues freeze-slow-crash-leak VS Code crashing, performance, freeze and memory leak issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants