Skip to content

fix: memory leak in debug visualization session items - #336031

Merged
Connor Peet (connor4312) merged 2 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-debugVisualization-sessionItems
Sep 21, 2026
Merged

Connor Peet (connor4312) merged 2 commits into
microsoft:mainfrom
SimonSiefke:fix/memory-leak-debugVisualization-sessionItems

Conversation

@SimonSiefke

Copy link
Copy Markdown
Contributor

Details

Debug visualization tree items are saved in extension-host lookup maps. Ending a debug session does not remove its items, and pending provider requests can save more items after that session has stopped.

Change

Track each item's debug sessions, remove it when its last session stops, and discard late results for stopped sessions. Preserve items still used by another live session.

Before

When starting and stopping a debug session with visualization items 37 times, 37 old tree items remain in the extension host:

debug-tree-before

After

No more tree items from stopped debug sessions accumulate in the same 37-cycle test.

Test Video

debug-tree-desktop-video.webm

@connor4312 Connor Peet (connor4312) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@connor4312
Connor Peet (connor4312) merged commit 6590df2 into microsoft:main Sep 21, 2026
33 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.140.0 milestone Sep 21, 2026
Abdon Morales (abdonmorales) pushed a commit to abdonmorales/vscode-utcs that referenced this pull request Sep 23, 2026
…debugVisualization-sessionItems

fix: memory leak in debug visualization session items
(cherry picked from commit 6590df2)
@SimonSiefke
Simon Siefke (SimonSiefke) deleted the fix/memory-leak-debugVisualization-sessionItems branch September 29, 2026 11:15
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Nov 6, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants