-
Notifications
You must be signed in to change notification settings - Fork 133
Huge memory usage when analysis 9 lines python code #278
Comments
I can reproduce this against both the released version (on my personal machine) and master (on my dev machine). Sometimes I can cut and paste the code a few times to make it go past the ~2.5GB of usage, or even drop down to ~40MB. I did a memory snapshot when usage is high, and it seems like most of the memory is storing JSON-related objects ( Actually looking at some of the objects shows that they're cyclic. Maybe they're not getting GC'd properly. |
I'll look at this more tomorrow (so it's not midnight), but after following the "path to root" for many of these objects, they all seem to lead up to Actions in StreamJsonRpc which are holding onto JsonRpcMessages with their status set to "RanToCompletion". |
- Fix issue microsoft#109: Reloading modules leaks memory - Fix issue microsoft#278: Huge memory usage when analysis 9 lines python code - Some code clean-up
#280 fixes it. Your example now sits at a nice 26MB on my system. 😄 Thanks for providing a concise way to reproduce the issue. |
Thank you for all of your nice and quick response. |
@jxww - no. Extension only updates LS with stable releases while this change is less than a day old. The change will be available for insiders build of the extension some time in the next few days. We do not push beta bits to stable releases. |
- Fix issue microsoft#109: Reloading modules leaks memory - Fix issue microsoft#278: Huge memory usage when analysis 9 lines python code - Some code clean-up
Hi everyone,
I am writing some python code using vscode with python-language-server extension and just find out
Microsoft.Python.LanguageServer.exe
eat all of my memory (over 8g) when I open a specific file. I finnally reduced the problematic file to the following 9 lines and the language server still use over 2.6g memory.Python code:
The interesting thing is that if I remove any of the class/method or change any of the
test
token in the code, then the language server will run normally with only 100+m memory cost.My environment is as follow:
I think the may be something wrong in code analysis. Anyone can fix it? Thanks very much.
The text was updated successfully, but these errors were encountered: