-
Notifications
You must be signed in to change notification settings - Fork 29.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add missing disposals #155976
Add missing disposals #155976
Conversation
@Tyriar I think there is at least one more retainer than these ones which is the action bar button actions (split/kill terminal) inside the terminal tabs list: One guess is that the registration of the DOM mousedown/tap events doesn't get disposed when the terminal is closed, and more and more event registrations referencing terminals are being done in the action bar without being cleaned up when terminals are closed. But I get a bit lost in the disposals at this time... |
Thanks again for this, these PRs are great! We do a big cleanup every now and then when we notice something is off, not sure how we could test to prevent regressions 🤔 I think we could fix this by adding vscode/src/vs/workbench/contrib/terminal/browser/terminalTabsList.ts Lines 471 to 480 in 9ba5ee2
To |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if that template.elementDisposables
idea doesn't work
@Tyriar Nope, chaning from line 484 to this:
Doesn't seem to change anything, the retainer still looks like the screenshot in my last comment. |
Removing the template.actionBar.push line seems to solve it, but there is pretty much going on in the actionbar push function |
@Tyriar I found it! Action bars are not disposed when a terminal is closed, they are cached in the list until you open a new terminal, so manually clear it to make it possible to garbage collect the closed terminal directly. |
I did some V8 heap profiling and found a few more places where references to closed terminals prevents them from being garbage collected.
Action bars are not disposed when a terminal is closed, they are cached in the list until you open a new terminal, so manually clear it to make it possible to garbage collect the closed terminal directly.
#155232
I did some V8 heap profiling and found a few more places where
references to closed terminals prevents them from being garbage
collected.