-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Closed
Labels
Area-UserInterfaceIssues pertaining to the user interface of the Console or TerminalIssues pertaining to the user interface of the Console or TerminalIssue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Priority-1A description (P1)A description (P1)Product-TerminalThe new Windows Terminal.The new Windows Terminal.Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.Fix is checked in, but it might be 3-4 weeks until a release.Severity-BlockingWe won't ship a release like this! No-siree.We won't ship a release like this! No-siree.
Description
Environment
Dev Latest
Steps to reproduce
- Measure memory
- Create 10 tabs
- Open Tab Switcher
- Close 10 tabs
Expected behavior
Memory is back to normal
Actual behavior
Memory remains high until Command Palette (action mode) is open.
Same test without opening tab switcher returns memory usage back to normal.
Observations
- Heap analysis shows that
TerminalTabobjects are still alive. Most probably due toCommandPalettestill holding a reference to them somehow (I believe this semi-leak exists in 1.5 or earlier, but became painful since introduction ofTabPaletteItem, as now we hold a reference to a tab rather thanSwitchToTabCommand) - We do not not reset tabs in Palette upon tab removal. This is something we need to fix. But it is insufficient to explain this "leak" - we do call
SetTabson the following invocations of TabSwitcher and yet it does not release the memory - I tried to track when the actual memory release happens, and it looks that it is insufficient to switch to the action mode in the code, we really need to make the palette visible before the memory is released. This led me to the thought that the view is somehow holding the ref-count, although the model has already changed.
- I blamed
x:Bindnot handlingPropertyChangedref-counting correctly (like here: Navigation Memory Leak microsoft-ui-xaml#934). But removing theINotifyPropertyChangedcompletely and even converting the bindings toOneTimedidn't help. So now I am not sure if this is the right direction
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Area-UserInterfaceIssues pertaining to the user interface of the Console or TerminalIssues pertaining to the user interface of the Console or TerminalIssue-BugIt either shouldn't be doing this or needs an investigation.It either shouldn't be doing this or needs an investigation.Priority-1A description (P1)A description (P1)Product-TerminalThe new Windows Terminal.The new Windows Terminal.Resolution-Fix-CommittedFix is checked in, but it might be 3-4 weeks until a release.Fix is checked in, but it might be 3-4 weeks until a release.Severity-BlockingWe won't ship a release like this! No-siree.We won't ship a release like this! No-siree.