Repository navigation
fix: memory leak in notebook attachment diagnostics - #333383
Merged
Dmitriy Vasyura (dmitrivMS) merged 3 commits intoSep 18, 2026
Merged
Dmitriy Vasyura (dmitrivMS) merged 3 commits into
Dmitriy Vasyura (dmitrivMS) merged 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Removes stale notebook image-attachment diagnostic entries during notebook and cell lifecycle events.
Changes:
- Deletes diagnostics for removed cells.
- Clears diagnostics when documents or notebooks close.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Megan Rogge (meganrogge)
approved these changes
Aug 31, 2026
Megan Rogge (meganrogge)
left a comment
Collaborator
There was a problem hiding this comment.
Thank you!
Connor Peet (connor4312)
approved these changes
Aug 31, 2026
roblourens
approved these changes
Aug 31, 2026
Collaborator
|
Checks failing |
Simon Siefke (SimonSiefke)
deleted the
fix/memory-leak-notebook-attachment-diagnostics
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: dispose notebook attachment diagnostics * fix: preserve diagnostics when moving notebook cells --------- Co-authored-by: Dmitriy Vasyura <[email protected]> (cherry picked from commit b995b9f)
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 notebook cells are removed or their text documents close, the attachment cleaner clears their image-attachment diagnostics but leaves the URI entries in the diagnostic collection. Closing a notebook has the same problem, so repeated split, merge, close, and reopen operations leave more empty entries behind.
Change
Delete each cell URI from the image-attachment diagnostic collection when the cell is removed, its text document closes, or the notebook closes.
Before
Across 37 notebook lifecycle iterations,
named-function-count3reports 74ResourceMapEntryinstances, an increase of 39, in theNotebook Image Attachmentdiagnostic collection.After
No named-function leak rows are detected across 37 notebook split, merge, close, and reopen iterations.
Test Video
notebook-editor-lifecycle-churn.webm