-
Notifications
You must be signed in to change notification settings - Fork 283
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
Completions stop working during heavy usage #3009
Comments
Thanks for logging the issue @chris-armstrong and grabbing the logs!
This is great to hear 😄 Sounds like you're exercising it thoroughly.
I believe your assessment is accurate - my suspicion is that we're hitting the heap memory limit of Node (suggesting some memory leak). Another possibility is we're hitting the open file descriptor limit. I'm going to take a look and see if I see anything odd in the memory profiler. Some extra data points that might be helpful:
Also I've upgraded our Node version for the extension host in #3012 - Node 12 -> 14 goes from the v8 Javascript engine version v7.x to v8.x (with several performance improvements), but I don't think this is the root issue. |
I'm using the nightly build on MacOS X.
Is there any debugging or profiling I can run locally? Node.js is more my domain than Reason :-) and it would be nice to get to the bottom of this.
|
Pick up some performance improvements from node v12 -> node v14 for the extension host (notably, updating v8 from v7.x to v8.x) Prompted by #3009 __TODO:__ - [x] Upgrade vendored node 14 on Windows - [x] Upgrade vendored node 14 on OSX
When I profile the memory, I'm seeing the same object tree on SuggestAdapter - the `ExtHostLanguageFeatures` class seems to keep a cache of suggestion items, which AFAICT aren't removed until `$releaseCompletionItems` is called - is it possible there needs to be a message back to the extension host telling it when it can let go of suggestions?
https://github.com/onivim/vscode-exthost/blob/master/src/vs/workbench/api/common/extHostLanguageFeatures.ts
|
@chris-armstrong - ah, nice investigation, thanks for profiling too! I was thinking the same thing. We're missing those Looks like the signature help / codelens may also be affected |
Thanks! Looking forward to the fix for this, apart from buggy vim-surround support, this is probably the main blocker for me day-to-day with Onivim2 |
…cache (#3016) __Issue:__ There is a memory leak in our completion items, signature help, and codelens via the extension host - may be responsible for the `SIGABRT` described in #3009 (as this can occur when the JS heap is out of memory). __Defect:__ The extension host adds a layer on top of the language server protocol, to serve as a cache for several language features - this helps performance when resolving items. However, this caching layer relies on the client to notify it when the items are no longer in use, so they can be cleaned up. Onivim was missing this `release` step. __Fix:__ Bake in the call to `release` in all the relevant subscriptions. This involves picking up the `cacheId` which wasn't wired up in some places (like codelens), setting up the `release*` API, and passing it back on conclusion of the subscription. To test this fix - I flipped the `Cache.enableDebugLogging` flag in the extension host and initiated several completions. Before this fix, it's obvious the caches were simply growing endlessly: ``` CompletionItem cache size — 1 CompletionItem cache size — 1 CompletionItem cache size — 2 CompletionItem cache size — 2 SignatureHelp cache size — 1 CompletionItem cache size — 3 CompletionItem cache size — 3 CompletionItem cache size — 4 CompletionItem cache size — 4 SignatureHelp cache size — 2 ... CompletionItem cache size — 15 CompletionItem cache size — 15 CompletionItem cache size — 16 CompletionItem cache size — 16 CompletionItem cache size — 17 CompletionItem cache size — 17 SignatureHelp cache size — 8 CompletionItem cache size — 18 CompletionItem cache size — 18 CompletionItem cache size — 19 CompletionItem cache size — 19 ``` After this fix, though, we can observe that the cache gets cleaned: ``` CompletionItem cache size — 1 CompletionItem cache size — 1 CompletionItem cache size — 0 CompletionItem cache size — 0 CompletionItem cache size — 1 CompletionItem cache size — 1 CompletionItem cache size — 0 CompletionItem cache size — 0 SignatureHelp cache size — 1 SignatureHelp cache size — 0 ... CompletionItem cache size — 0 CompletionItem cache size — 0 SignatureHelp cache size — 1 SignatureHelp cache size — 0 ``` Related #3009 Related #1058
This is behaving so much better now that the #3016 fix is in. I've profiled it again and the memory usage is much more stable and not growing. Happy for this to be closed. |
Awesome news! Thanks for the update and all your help investigating @chris-armstrong - I'll close this out! |
I'm using Onivim2 as my day-to-day editor (it's pretty good!), and a recurrent problem I'm finding is that the completion suggestions will stop working at some point after starting it up, requiring a restart of Onivim2 to get them working again. I've tried executing the 'Typescript: Restart TS Server' option, but this doesn't seem to work.
I'm running completions on TypeScript files. I ran onivim2 with logging enabled, and found this at the time of its failure which suggestions the VSCode extension host died:
The last error,
Stream.write bad file descriptor
continues to occur after this point (I could find no instances of it before).I know this only suggests the extension host received a SIGABRT (maybe an out of memory condition?), so I realise I'll probably have to dig deeper. Can anyone suggest how I might capture some more information about the extension host connection or from the extension host itself to debug this, or any other pointers?
The text was updated successfully, but these errors were encountered: