Skip to content

fix: memory leak in document drop edits - #336025

Merged
Alexandru Dima (alexdima) merged 2 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-documentDropEdit-cacheIds
Sep 14, 2026
Merged

Alexandru Dima (alexdima) merged 2 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-documentDropEdit-cacheIds

Conversation

@SimonSiefke

Copy link
Copy Markdown
Contributor

Details

Document-drop edits are cached using their edit IDs, but the release call sends the separate data-transfer request ID. The extension host therefore leaves the old edits in its cache.

Change

Release the cache IDs returned with the edits. Avoid creating cache entries for empty results, which have no edit ID to release.

Before

When dropping text into an editor 37 times, 37 old drop edits remain in the extension-host cache:

drop-before

After

No more document-drop edit cache growth is detected in the same 37-cycle test.

Test Video

drop-v2-desktop-video.webm

@alexdima

Copy link
Copy Markdown
Member

Thank you!

@alexdima
Alexandru Dima (alexdima) merged commit 5aa0954 into microsoft:main Sep 14, 2026
33 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.139.0 milestone Sep 14, 2026
@SimonSiefke
Simon Siefke (SimonSiefke) deleted the fix/memory-leak-documentDropEdit-cacheIds 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 document drop edit cache release IDs

(cherry picked from commit 5aa0954)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants