Repository navigation
fix: memory leak in debugModel - #327047
Merged
Dmitriy Vasyura (dmitrivMS) merged 2 commits intoJul 23, 2026
Merged
Dmitriy Vasyura (dmitrivMS) merged 2 commits into
Dmitriy Vasyura (dmitrivMS) merged 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes retained inactive child debug sessions when a root session is replaced.
Changes:
- Adds root-session ancestry cleanup logic.
- Adds regression coverage for disposing replaced session trees.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
debugModel.ts |
Disposes inactive descendants of replaced root sessions. |
callStack.test.ts |
Tests replacement cleanup. |
Dmitriy Vasyura (dmitrivMS)
approved these changes
Jul 23, 2026
Paul (pwang347)
approved these changes
Jul 23, 2026
Collaborator
|
Simon Siefke (@SimonSiefke) Thank you! |
roblourens
approved these changes
Jul 23, 2026
Dmitriy Vasyura (dmitrivMS)
merged commit Jul 23, 2026
8bcc12e
into
microsoft:main
46 of 47 checks passed
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
Disposes inactive child debug sessions when their root session is replaced.
Before
When debugging the same JavaScript file 37 times, inactive debug sessions, schedulers, cancellation tokens, and REPL models grow each time (outlined in red):
After
No more leak is detected for these objects after debugging the same file 17 times.
Test Video
debug-javascript-test.mp4