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 when creating many decoration types and disposing them #7609
Comments
Note that decoration types are kept until you call dispose on them. I will have a look, but it's clear you can't create too many of them. |
I call
Oh, it's awesome, I didn't realise that, thanks for noting it. It fits my scenario much better than creating a lot of decoration types. |
The
Spotted and fixed while merging #6553 |
Thanks @alexandrudima ! |
Using the snippet user provided I can still crash VScode after 1 minute, not sure if that is expected (there is a timeout of 1ms, so it is really adding a bunch of decorations). Though I do not get an error in the console, just after running the extension whole vscode crashes. Reopening so @alexandrudima can decide if this is expected or not |
I have a fix in a09ee36 |
@jrieken Pushed fix to |
Change looks good, works in |
Now when it's possible to set the
contentText
for a decoration with this change, one may need to create quite a few transient decoration types to display/update the side content for certain code lines.I tried to simulate my scenario and it looks like some resources are not cleared when disposing a decoration type.
Steps to Reproduce:
Here is the test code:
The memory consumption grows rapidly and after a couple of minutes I get the process crash:
Note that the issue can be reproduced with the current release version on VS Code (not only the insiders build), so it wasn't introduced by the change.
The text was updated successfully, but these errors were encountered: