You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
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.
We use pipenv with the PIPENV_VENV_IN_PROJECT=1 which means that we have a .venv folder in our workspace (though also in .gitignore). No idea if that might be the cause.
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:
Reloading modules ....
done.
done.
done.
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).
Running vs code 2 days straight and the memory usage didn't exceed 600MB of RAM.
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.
I have the 0.1.72 Version of the language server and python extension "2018.12.1"
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
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
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).
Uhhh... Explains why everything was slower then normal I guess... Best part is that after a certain point intellisense stops working in python altogether.
Microsoft Python Language Server version 0.1.75.0
Python Extension 2018.12.1
VSCode 1.30.2
Mac OSX High Sierra 10.13.6
Reacted by Jan Stratil, HognGa4z, Janosh Riebesell and Seyyed Hossein Hasanpour
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, Mikhail Arkhipov (@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.
Language Server version < 0.2.16 still has the memory leak for me. Installing version 0.2.16 following Jake Bailey (@jakebailey) comment throws an error:
[Info - 1:05:59 PM] Microsoft Python Language Server version 0.2.16.0
[Info - 1:05:59 PM] Initializing for /home/user/dev/virtualenv/pytorch/bin/python
[Error - 1:11:34 PM] Request textDocument/completion failed.
Message: Specified argument was out of the range of valid values.
Parameter name: index
Code: -32000
at System.Char.IsLetter(String s, Int32 index)
at Microsoft.Python.LanguageServer.Completion.CompletionItemSource.CreateCompletionItem(String text, CompletionItemKind kind)
at System.Linq.Enumerable.SelectEnumerableIterator`2.ToArray()
at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
at Microsoft.Python.LanguageServer.Completion.ImportCompletion.TryGetCompletions(ImportStatement import, CompletionContext context)
at Microsoft.Python.LanguageServer.Completion.CompletionSource.GetCompletions(IDocumentAnalysis analysis, SourceLocation location)
at Microsoft.Python.LanguageServer.Implementation.Server.Completion(CompletionParams params, CancellationToken cancellationToken)
at Microsoft.Python.LanguageServer.Implementation.LanguageServer.Completion(JToken token, CancellationToken cancellationToken)
Today I faced this issue! it took more than 10GB+ of my system RAM. I cant reproduce it now (see below), it seems when this happens, the intellisense also stops working. and analysis goes on forever!
I'm using the latest version
Python Language Server: Microsoft Python Language Server version 0.3.46.0 Python Extension : 2019.8.29288 (6 August 2019) VSCode info
Seyyed Hossein Hasanpour (@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.
Jake Bailey (@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.
Activity
jakebailey commentedon Dec 3, 2018
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.
mungojam commentedon Dec 4, 2018
I had this at one point too today with 0.1.65.0.
We use pipenv with the
PIPENV_VENV_IN_PROJECT=1which means that we have a .venv folder in our workspace (though also in .gitignore). No idea if that might be the cause.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
Honzys commentedon Dec 10, 2018
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.
Honzys commentedon Dec 15, 2018
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).
Running vs code 2 days straight and the memory usage didn't exceed 600MB of RAM.
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!
Drakezul commentedon Dec 16, 2018
While I do not know how to reproduce it I just peaked at 12GB again.
I have the 0.1.72 Version of the language server and python extension "2018.12.1"
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
Honzys commentedon Dec 23, 2018
Unfortunately the leaks are still here. But still dont know how to reproduce it.
touhidulshawan commentedon Dec 31, 2018
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
chopin1998 commentedon Jan 8, 2019
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..
koliyo commentedon Jan 11, 2019
Got the same thing, 25+ GB after a couple of days, not even using VS Code, just leaving it open.
Honzys commentedon Jan 16, 2019
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.
jakebailey commentedon Jan 16, 2019
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).
Penagwin commentedon Jan 22, 2019
Uhhh... Explains why everything was slower then normal I guess... Best part is that after a certain point intellisense stops working in python altogether.

Microsoft Python Language Server version 0.1.75.0
Python Extension 2018.12.1
VSCode 1.30.2
Mac OSX High Sierra 10.13.6
MikhailArkhipov commentedon Feb 6, 2019
#546
coobas commentedon Feb 12, 2019
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, Mikhail Arkhipov (@MikhailArkhipov) ?
jakebailey commentedon Feb 12, 2019
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.
coobas commentedon Feb 12, 2019
Thanks a lot for your prompt answer and all your effort! Will be waiting for the 0.2.x release.
koliyo commentedon Feb 20, 2019
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!
lunxian commentedon Mar 3, 2019
I have the same issue cause I need restart vs frequently.
Waiting for 0.2.x to resolve it.
jakebailey commentedon Mar 6, 2019
0.2.16 is now available on beta channel. You can set this in your VS Code
settings.jsonto get it:tomrunia commentedon Mar 7, 2019
Language Server version < 0.2.16 still has the memory leak for me. Installing version 0.2.16 following Jake Bailey (@jakebailey) comment throws an error:
coobas commentedon Mar 8, 2019
Thanks a lot for letting us know.
dreamfalcon commentedon Mar 26, 2019
The beta version solved the problem.
Thanks
Coderx7 commentedon Aug 12, 2019
Today I faced this issue! it took more than 10GB+ of my system RAM.
I cant reproduce it now(see below), it seems when this happens, the intellisense also stops working. and analysis goes on forever!I'm using the latest version
Python Language Server:
Microsoft Python Language Server version 0.3.46.0Python Extension :
2019.8.29288 (6 August 2019)VSCode info
UPDATE:
OK this happened again and I could save the log and record it before the vscode crashed!

Here is the console log :
jakebailey commentedon Aug 12, 2019
Seyyed Hossein Hasanpour (@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
Coderx7 commentedon Aug 12, 2019
Jake Bailey (@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.