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 }}
Repository navigation
Python Language Server uses too much RAM / Memory #2594
changed the title [-]Python Language Server uses wayyyy too much RAM / Memory[/-][+]Python Language Server uses too much RAM / Memory[/+]on Sep 14, 2018
The python extension is using nearly all my memory on my desktop computer, too. Task Manager says memory is eaten up by Microsoft.Python.LanguageServer
I have same issue on Linux Mint 18.3 with VS Code Version: 1.27.2 and extension 2018.8.0. After some time it uses all the RAM and starts flooding swap.
For those of you bumping up against this, a reminder that setting "python.jediEnabled": true in your settings will switch you back to Jedi and off the language server.
David (@hmnd) - it does, it is simply not currently public (i.e. not listed in package.json). There are some development settings that rarely matter to regular users.
Mikhail Arkhipov (@MikhailArkhipov) doesn't help. I'm tried to restart VS Code after added this flag, but now it started to consume all resources again:
If I kill process I'm getting this error on Output tab:
[Info - 3:47:40 PM] Connection to server got closed. Server will restart.
[Error - 3:47:40 PM] Request textDocument/documentSymbol failed.
Error: Connection got disposed.
at Object.dispose (/Users/xen/.vscode/extensions/ms-python.python-2018.8.0/node_modules/vscode-jsonrpc/lib/main.js:825:25)
at Object.dispose (/Users/xen/.vscode/extensions/ms-python.python-2018.8.0/node_modules/vscode-languageclient/lib/client.js:57:35)
at LanguageClient.handleConnectionClosed (/Users/xen/.vscode/extensions/ms-python.python-2018.8.0/node_modules/vscode-languageclient/lib/client.js:2036:42)
at LanguageClient.handleConnectionClosed (/Users/xen/.vscode/extensions/ms-python.python-2018.8.0/node_modules/vscode-languageclient/lib/main.js:127:15)
at closeHandler (/Users/xen/.vscode/extensions/ms-python.python-2018.8.0/node_modules/vscode-languageclient/lib/client.js:2023:18)
at CallbackList.invoke (/Users/xen/.vscode/extensions/ms-python.python-2018.8.0/node_modules/vscode-jsonrpc/lib/events.js:71:39)
at Emitter.fire (/Users/xen/.vscode/extensions/ms-python.python-2018.8.0/node_modules/vscode-jsonrpc/lib/events.js:135:36)
at closeHandler (/Users/xen/.vscode/extensions/ms-python.python-2018.8.0/node_modules/vscode-jsonrpc/lib/main.js:221:26)
at CallbackList.invoke (/Users/xen/.vscode/extensions/ms-python.python-2018.8.0/node_modules/vscode-jsonrpc/lib/events.js:71:39)
at Emitter.fire (/Users/xen/.vscode/extensions/ms-python.python-2018.8.0/node_modules/vscode-jsonrpc/lib/events.js:135:36)
at StreamMessageReader.AbstractMessageReader.fireClose (/Users/xen/.vscode/extensions/ms-python.python-2018.8.0/node_modules/vscode-jsonrpc/lib/messageReader.js:135:27)
at Socket.<anonymous> (/Users/xen/.vscode/extensions/ms-python.python-2018.8.0/node_modules/vscode-jsonrpc/lib/messageReader.js:188:62)
at emitOne (events.js:121:20)
at Socket.emit (events.js:211:7)
at Pipe._handle.close [as _onclose] (net.js:554:12)
Initializing for /Users/xen/.local/share/virtualenvs/notify-1dEpo5ac/bin/python
Upd. In status line also shown spinning arrows circle with text "Analyzing workspace, 14 items remaining..."
I tried with "python.analysis.watchSearchPaths": false as you instructed but the behaviour persists, memory usage keeps increasing.
Maybe worth to mention, I'm running with only 8G of RAM and I don't know if memory usage stops increasing at some point because the system runs out of memory if I don't quit VSCode.
This is the output of grep python ~/.config/Code/User/settings.json:
After re-downloading language server, I see the following in the output panel:
Starting Microsoft Python language server.
Initializing for /.../.pyenv/versions/thefuck-370/bin/python
##########Linting Output - flake8##########
##########Linting Output - flake8##########
[Error - 3:10:43 PM] System.InvalidOperationException: Collection was modified; enumeration operation may not execute.
at System.Collections.Generic.HashSet`1.Enumerator.MoveNext()
at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.OfTypeIterator[TResult](IEnumerable source)+MoveNext()
at System.Collections.Generic.List`1.AddEnumerable(IEnumerable`1 enumerable)
at System.Collections.Generic.List`1.InsertRange(Int32 index, IEnumerable`1 collection)
at Microsoft.PythonTools.Analysis.PythonAnalyzer.GetEntriesThatImportModule(String moduleName, Boolean includeUnresolved)
at Microsoft.Python.LanguageServer.Implementation.Server.OnDocumentChangeProcessingCompleteAsync(IDocument doc, VersionCookie vc, Boolean enqueueForAnalysis, AnalysisPriority priority, IDisposable disposeWhenEnqueued)
I hope this helps. I'm still looking forward to a chance (aka free time) to test the development build, as Brett Cannon (@brettcannon) suggested. I'll do so ASAP.
We believe this issue has been resolved.
We just released the latest version of the Python Extension, please update to this new version 2018.9.0 and give it a go.
Noj Vek (@nojvek) If I remember correctly it was from the language server constantly re-processing modules as they changed but not freeing the memory from the old analyses.
Activity
[-]Python Language Server uses wayyyy too much RAM / Memory[/-][+]Python Language Server uses too much RAM / Memory[/+]ueoo commentedon Sep 15, 2018
I have the same issue with VS Code version 1.27.2
ueoo commentedon Sep 15, 2018
Cause to VS Code not responding...
tadly commentedon Sep 16, 2018
Same here and unlike #2553, I have jedi disabled.
JPhillot commentedon Sep 17, 2018
Same here.
I use vscode as git editor and also as mergetool.
My git config:
After each merge conflict fixed in vscode, the server seems to not release the used RAM.
blaylockbk commentedon Sep 17, 2018
The python extension is using nearly all my memory on my desktop computer, too. Task Manager says memory is eaten up by
Microsoft.Python.LanguageServerkrmozejko commentedon Sep 18, 2018
I have same issue on Linux Mint 18.3 with VS Code Version: 1.27.2 and extension 2018.8.0. After some time it uses all the RAM and starts flooding swap.
brettcannon commentedon Sep 18, 2018
For those of you bumping up against this, a reminder that setting
"python.jediEnabled": truein your settings will switch you back to Jedi and off the language server.34 remaining items
MikhailArkhipov commentedon Oct 4, 2018
David (@hmnd) - it does, it is simply not currently public (i.e. not listed in package.json). There are some development settings that rarely matter to regular users.
hmnd commentedon Oct 4, 2018
Mikhail Arkhipov (@MikhailArkhipov) Looks like ram usage remains incredibly high but it doesn't grow as quickly as before...
xen commentedon Oct 4, 2018
Mikhail Arkhipov (@MikhailArkhipov) doesn't help. I'm tried to restart VS Code after added this flag, but now it started to consume all resources again:
If I kill process I'm getting this error on
Outputtab:Upd. In status line also shown spinning arrows circle with text "Analyzing workspace, 14 items remaining..."
scorphus commentedon Oct 4, 2018
Mikhail Arkhipov (@MikhailArkhipov), thanks for your message.
I tried with
"python.analysis.watchSearchPaths": falseas you instructed but the behaviour persists, memory usage keeps increasing.Maybe worth to mention, I'm running with only 8G of RAM and I don't know if memory usage stops increasing at some point because the system runs out of memory if I don't quit VSCode.
This is the output of
grep python ~/.config/Code/User/settings.json:After re-downloading language server, I see the following in the output panel:
I hope this helps. I'm still looking forward to a chance (aka free time) to test the development build, as Brett Cannon (@brettcannon) suggested. I'll do so ASAP.
Thank you all for your time and support! 👍
MikhailArkhipov commentedon Oct 4, 2018
Most probably roots to
microsoft/python-language-server#193
microsoft/python-language-server#173
obrotowy commentedon Oct 7, 2018
Same on macOS 10.14 (18A391), VSCode 1.27.2 and vscode-python 2018.8.0. It used 22GB of RAM on my machine xD
DonJayamanne commentedon Oct 9, 2018
Noj Vek (@nojvek) tadly (@tadly) @SynneK1337 Pablo Aguiar (@scorphus) Mikhail Kashkin (@xen) David (@hmnd) Kyra (@heyakyra) Ahter Sonmez (@ahter) Brian Blaylock (@blaylockbk) Jerome Phillot (@JPhillot)
We believe this issue has been resolved.
We just released the latest version of the Python Extension, please update to this new version 2018.9.0 and give it a go.
hmnd commentedon Oct 9, 2018
Looks like it's fixed for me Don Jayamanne (@DonJayamanne)
xen commentedon Oct 10, 2018
I tried and its works. Thank you very much for this changes and for your amazing work.
nojvek commentedon Oct 10, 2018
Thanks. Y’all so 😎.
I’m just curious what the technical issue was that caused such a collosal memory conquest?
brettcannon commentedon Oct 10, 2018
Noj Vek (@nojvek) If I remember correctly it was from the language server constantly re-processing modules as they changed but not freeing the memory from the old analyses.