Repository navigation
fix: memory leak in extension host comments - #334095
Merged
Alex Ross (alexr00) merged 2 commits intoSep 3, 2026
Merged
Alex Ross (alexr00) merged 2 commits into
Alex Ross (alexr00) merged 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The cleanup is covered by a regression test, with no unresolved issues.
Pull request overview
Fixes a memory leak by removing disposed comment controllers from extension-host bookkeeping.
Changes:
- Removes disposed controllers from the handle map.
- Deletes unused per-extension controller storage.
- Adds regression coverage for disposal cleanup.
File summaries
| File | Description |
|---|---|
src/vs/workbench/api/test/common/extHostComments.test.ts |
Verifies disposed controllers cannot receive thread requests. |
src/vs/workbench/api/common/extHostComments.ts |
Cleans up controller bookkeeping on disposal. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Alex Ross (alexr00)
approved these changes
Sep 3, 2026
Alex Ross (alexr00)
left a comment
Member
There was a problem hiding this comment.
Thank you for the PR!
Alex Ross (alexr00)
enabled auto-merge (squash)
September 3, 2026 09:12
Christof Marti (chrmarti)
approved these changes
Sep 3, 2026
Simon Siefke (SimonSiefke)
deleted the
fix/memory-leak-extHostComments
branch
September 20, 2026 07:39
Abdon Morales (abdonmorales)
pushed a commit
to abdonmorales/vscode-utcs
that referenced
this pull request
Sep 23, 2026
* fix: memory leak in extHostComments * Attestation commit --------- Co-authored-by: Alex Ross <[email protected]> (cherry picked from commit 6f7c195)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details
When an extension creates a comment controller, the extension host stores the controller by its handle. Disposing the controller unregisters it from the main thread, but does not remove it from the extension host map.
Change
Remove disposed comment controllers from the extension host map and remove the unused per-extension controller list.
Before
When a comment controller is created and disposed 37 times,
ExtHostCommentControllerand its API callbacks grow by 37:After
No more extension host comment controller leak is detected.
Test Video
test-video.webm