Skip to content
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

VS Code: tree-sitter wasm bindings memory issue #3799

Closed
valerybugakov opened this issue Apr 15, 2024 · 4 comments
Closed

VS Code: tree-sitter wasm bindings memory issue #3799

valerybugakov opened this issue Apr 15, 2024 · 4 comments

Comments

@valerybugakov
Copy link
Member

  • Tree-sitter WASM bindings usage causes V8 external memory to grow linearly with the number of documents parsed with no clear way to free it.
  • Unit test for reproduction TreeSitter memory leak repro #3788
  • Related GitHub threads: #1, #2, #3
  • I'm able to clean up the V8 external memory that grows in tests, but for that, I hacked a couple of changes into the pre-build tree-sitter WASM bindings. With them, I re-create a new parser instance after parsing 10k documents which allows GC to clean up the previously created WebAssembly.Memory instance
  • Slack thread.
Copy link

This issue is marked as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed automatically in 5 days.

@github-actions github-actions bot added the Stale label Jul 11, 2024
@saoudrizwan
Copy link

saoudrizwan commented Aug 2, 2024

@valerybugakov I've run into a similar issue with web-tree-sitter, is there something you recommend for freeing the memory from a vscode extension using the wasm vs altering the wasm itself?

One of my extensions' users is saying that even after updating the extension/restarting vscode, there is still some memory leak causing significant performance issues in the extension, so I'm thinking vscode is holding onto whatever memory was allocated for the wasm because it failed and got into a problematic state. I would assume restarting the extension would clear this memory but that doesn't seem to be the case. I want to add something to my extensions activation to clear up this used memory for this user that was affected v.s. having him clear out his vscode cache for example.

Copy link

github-actions bot commented Oct 2, 2024

This issue is marked as stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed automatically in 5 days.

@github-actions github-actions bot added the Stale label Oct 2, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2024
@valerybugakov
Copy link
Member Author

Hey @saoudrizwan! Check out this PR for the solution we came up with: #5460

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants