You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Multifile diff editor leaks models and editor after closing and hiding #228367
bugIssue identified by VS Code Team member as probable bugfreeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issuesinsiders-releasedPatch has been released in VS Code InsidersuxUser experience issuesverifiedVerification succeededworkspace-edit
Does this issue occur when all extensions are disabled?: Yes/No
VS Code Version: 1.93.0 (Universal)
OS Version: OS: Darwin arm64 23.6.0
Steps to Reproduce:
Make Refactor Preview appear (e.g. open some file and try some of Refactor... context actions)
Close the preview editor via Discard button
Call vscode.window.visibleTextEditors
It contains the vscode-bulkeditpreview-editor://... editor that corresponds to the Refactor Preview we just closed as well as the file that refactor preview was referencing
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.93.1. Please try upgrading to the latest version and checking whether this issue remains.
changed the title [-]`Refactor Preview` text editors are still reported by `vscode.window.visibleTextEditors` after they're closed[/-][+]Multifile diff editor leaks models and editor after closing and hiding[/+]on Sep 25, 2024
Sharing media and context from merged PR #333186 for verification:
Details
Opening and closing the Source Control multi-diff editor 37 times retained 37 MultiDiffEditorInput instances, 37 view models and SCM sources, and 111 diff items. The shortest retaining path ended at MainThreadEditorTabs._multiDiffEditorInputListeners.
Change
Dispose the multi-diff resource listener using the original editor input stored in TabInfo when the tab closes. Add a browser regression assertion that the listener map returns to zero after the open/close event sequence.
Before
The multi-diff input graph grew once per iteration. The highlighted rows are fixed by this change; the unrelated DomListener row is intentionally excluded.
After
The multi-diff inputs, sources, view models, items, and tab listener callbacks no longer grow. A separate DomListener row remains at the unchanged baseline delta of 69 and is outside this focused fix.
bugIssue identified by VS Code Team member as probable bugfreeze-slow-crash-leakVS Code crashing, performance, freeze and memory leak issuesinsiders-releasedPatch has been released in VS Code InsidersuxUser experience issuesverifiedVerification succeededworkspace-edit
Activity
vs-code-engineering commentedon Sep 12, 2024
Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.93.1. Please try upgrading to the latest version and checking whether this issue remains.
Happy Coding!
werat commentedon Sep 12, 2024
I've just updated and tried it on 1.93.1 -- I can confirm that it still reproduces.
jrieken commentedon Sep 16, 2024
Henning Dieterichs (@hediet) it seems that closing the preview editor doesn't reset it, e.g all editors and its models are still around
[-]`Refactor Preview` text editors are still reported by `vscode.window.visibleTextEditors` after they're closed[/-][+]Multifile diff editor leaks models and editor after closing and hiding[/+]27 remaining items
dmitrivMS commentedon Sep 28, 2026
Fix is in #228367
vs-code-engineering commentedon Sep 29, 2026
Sharing media and context from merged PR #333186 for verification:
Details
Opening and closing the Source Control multi-diff editor 37 times retained 37
MultiDiffEditorInputinstances, 37 view models and SCM sources, and 111 diff items. The shortest retaining path ended atMainThreadEditorTabs._multiDiffEditorInputListeners.Change
Dispose the multi-diff resource listener using the original editor input stored in
TabInfowhen the tab closes. Add a browser regression assertion that the listener map returns to zero after the open/close event sequence.Before
The multi-diff input graph grew once per iteration. The highlighted rows are fixed by this change; the unrelated
DomListenerrow is intentionally excluded.After
The multi-diff inputs, sources, view models, items, and tab listener callbacks no longer grow. A separate
DomListenerrow remains at the unchanged baseline delta of 69 and is outside this focused fix.Test Video
test-video.webm
Source PR: #333186