-
Notifications
You must be signed in to change notification settings - Fork 9
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
Memory leak #3
Comments
I see a memory leak associated with the use of context menu over the output node (which can be used to select "Clear Outputs" or "Clear All Outputs"). This is because when context menu gets invoked, the event gets retained on As for fixing this, we could empty the contents of the node on disposal. This way the detached node will still be there but it will not contain a reference to the long string or anything else, allowing those to be freed. Any solution that would dispose the problematic event reference would break Can you confirm that you do not see a memory leak when using command palette to clear outputs? |
I can no longer reproduce this without limit output. I must have cleared output differently, Looking at this more, I think this is an upstream bug and maybe limit output makes it worse. Given and no limit output plugin installed:
Then I run clear output from the command pallet, I would expect to see no That being said, it seems the command palette does better than clear output for freeing memory when this plugin is enabled. |
With limit output set head/tail set to 50 characters, the following reproducers a memory leak likely in this plugin:
If you watch process memory it shoots up rapidly. When you clear all outputs it still stays high. Looking at a post-clear all outputs heap snapshot you can see the old strings there:
![image](https://user-images.githubusercontent.com/1813603/224370487-b2bd95b9-165b-4862-9dd2-cee0c1093d5d.png)
It's not clear the cause, but maybe we need to do something special for dispose?
The text was updated successfully, but these errors were encountered: