-
Notifications
You must be signed in to change notification settings - Fork 133
Language server leaks/eats 30+GB of RAM #450
Comments
0.1.60.0 is an older build. The current stable release is 0.1.65.0 and should be getting downloaded by the extension. (Your extension is also last month's build, but the language server download should be independent.) I don't think we had any fixes specifically for memory usage between those releases, but you may want to try the newer build. It would be helpful to know what project you're working on and if it's public such that we could test it. Your example in particular is interesting because it's high memory usage without the CPU usage being high. |
I had this at one point too today with 0.1.65.0. We use pipenv with the I've also noticed that ctrl+click on relative package references sometimes seems to spin for ever so perhaps that is causing an infinite loop that increases memory or something. Unfortunately I can't share our code and I haven't got time at the moment to recreate it |
I can confirm the memory leak too. After few hours the memory usage is huge (something about 5GB), after reload it comes back to the normal usage. But using vscode actively (but I sometimes noticed that the memory usage incresased without doing anything) slowly increases the memory usage. Don't know if this information will be helpful but I've noticed that in the output log was printed:
I was wondering why the LS reloads module so many times. The upper lines were interleaved with the linting output. I am using venv, mypy. If I notice anything else, I will edit this comment or add a new one. |
It seems to me that this issue was fixed with new version of python language server (actual version 0.1.72.0, previous version 0.1.65.0). It still needs further testing, but I just wanted to give this feedback, as I was happy seeing this issue (probably) gone in my case! Thank you very much! |
While I do not know how to reproduce it I just peaked at 12GB again. The "Process Explorer" in VS Code only showed a memory usage of ~ 3.8GB for the language server, as compared to Windows 10 Task Manager that showed ~12GB |
Unfortunately the leaks are still here. But still dont know how to reproduce it. |
I am using the latest version of languageServer 0.1.73. This python language server eats all my ram. For that, I can`t use vs code. Please tell me how to fix it |
same... .vscode/extensions/ms-python.python 2018.12.1/languageServer.0.1.72/Microsoft.Python.LanguageServer eat too much RAM, i just open two simple python file.. |
Got the same thing, 25+ GB after a couple of days, not even using VS Code, just leaving it open. |
Strange thing is, that the python language server causes those memory leaks even if I haven't opened any .py file. It took 75% memory of my 16GB total memory. |
When the language server starts, it begins analyzing every file within the workspace, which means that there won't be any difference between opening a file and not opening a file. Without an example codebase, this is very hard to pin down. If you're also seeing CPU usage during that time, then it may be the case that the analysis isn't stopping, continuing to use more memory as it grows type information (which is #495 and #479). Know that like #495 and #479, the memory usage issues should be handled with our new analysis approach. See Mikhail's comment here for more info: #479 (comment) The analysis approach as a whole will be different, and the files you open will impact what gets analyzed (versus analyzing unopened files that may not be referenced). |
I still observe regular memory leaks with current development build (2019.2.5135-alpha, Microsoft Python Language Server version 0.1.78.0). Is it supposed to be fixed in this version, @MikhailArkhipov ? |
No, it is not. That's the release branch. Our master contains an updated analyzer/language server but is not yet released for any users. When we make it generally available, we'll probably be bumping the version to v0.2.x. |
Thanks a lot for your prompt answer and all your effort! Will be waiting for the 0.2.x release. |
I have the same issue, leaking many GBs of memory per hour that VS Code is open. Looking forward to testing the 0.2.x release! |
I have the same issue cause I need restart vs frequently. |
0.2.16 is now available on beta channel. You can set this in your VS Code
|
Language Server version < 0.2.16 still has the memory leak for me. Installing version 0.2.16 following @jakebailey comment throws an error:
|
Thanks a lot for letting us know. |
The beta version solved the problem. |
Today I faced this issue! it took more than 10GB+ of my system RAM. Python Language Server:
UPDATE: OK this happened again and I could save the log and record it before the vscode crashed! |
@Coderx7 Please open a new issue; this one is old and unrelated. Providing the code that causes the issue (what you have in that file) would be helpful. Those logs are for VS Code, not the language server, and can't help us. Check this section of our troubleshooting guide for how to enable more logging for the language server and the info we'd be interested in: https://github.com/microsoft/python-language-server/blob/master/TROUBLESHOOTING.md#filing-an-issue |
@jakebailey : Thanks for the heads up. I created a new issue here and provided the logs you suggested in addition to the test script I used to replicate this. |
I'm not installing/updating any new packages. It just leaks lots of RAM over the time.
The text was updated successfully, but these errors were encountered: