Repository navigation
fix: memory leak in mapped edit provider disposal - #338245
Merged
Dmitriy Vasyura (dmitrivMS) merged 3 commits intoSep 28, 2026
Merged
Dmitriy Vasyura (dmitrivMS) merged 3 commits into
Dmitriy Vasyura (dmitrivMS) merged 3 commits into
Conversation
Copilot started reviewing on behalf of
Simon Siefke (SimonSiefke)
September 27, 2026 19:05
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Provider deletion can race with renderer requests already in transit.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Fixes retention of disposed mapped-edit providers in the extension host.
Changes:
- Removes providers from the map during disposal.
- Adds provider lifecycle and in-flight request tests.
| File | Description |
|---|---|
extHostCodeMapper.ts |
Deletes disposed provider entries. |
extHostCodeMapper.test.ts |
Tests registration, disposal, and request behavior. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Dmitriy Vasyura (dmitrivMS)
enabled auto-merge (squash)
September 28, 2026 06:01
Collaborator
|
Simon Siefke (@SimonSiefke) Thank you! |
Dmitriy Vasyura (dmitrivMS)
approved these changes
Sep 28, 2026
Martin Aeschlimann (aeschli)
approved these changes
Sep 28, 2026
auto-merge was automatically disabled
September 28, 2026 06:35
Pull request was closed
Dmitriy Vasyura (dmitrivMS)
enabled auto-merge (squash)
September 28, 2026 06:35
Christof Marti (chrmarti)
approved these changes
Sep 28, 2026
Simon Siefke (SimonSiefke)
deleted the
fix/memory-leak-mappedEdits-providerDisposal
branch
September 29, 2026 11:15
Abdon Morales (abdonmorales)
pushed a commit
to abdonmorales/vscode-utcs
that referenced
this pull request
Oct 1, 2026
* Fix disposed mapped-edit providers retained in extension host * fix: retain mapped edit providers until unregistration settles --------- Co-authored-by: Dmitriy Vasyura <dmitriv@microsoft.com> (cherry picked from commit 509aa24)
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Disposing a mapped-edit provider unregisters it in the renderer but leaves its entry in the extension host provider map. Repeated registration and disposal accumulates old providers.
Change
Delete the provider entry when its registration is disposed, before unregistering it in the renderer. Preserve the existing behavior of requests already in progress.
Before
Registering and disposing a mapped-edit provider 37 times adds 37 old provider objects. The provider map grows from 2 to 39 entries.
After
No more mapped-edit provider growth is detected in the same 37-cycle test. The provider map stays empty after disposal. Small unrelated object and promise differences remain in the full shape comparison.
Test Video
Seven mapped-edit provider registration and disposal cycles through the extension API.
test.mp4
AI disclosure: Model: GPT 6 Astra. Worktime: 21 min