Microsoft.Python.LanguageServer.exe eating all RAM and lots of CPU.
See original GitHub issueHi.
The Microsoft.Python.LanguageServer.exe is eating up all my memory. It goes all the way to 12 gigs, then drops down to 1gb, then climbs again, constantly.
I had this problem a week or two ago and it was cured by installing an ms-python-insiders.vsix manually. I think it’s updated itself and broken again.
I have tried python insiders extension, as well as the 2018.9 that is available from the side bar. I’ve also tried both with VSCode stable, as well as VSCode insiders.
Also “python.analysis.watchSearchPaths” : “false” has made no difference
My PC is going very slow and it’s swapping all over my SSD.
Any ideas?
Environment data
- VS Code version: 1.29.0-insider
- Extension version (available under the Extensions sidebar): 2018.9.0 and 2018.10-alpha
- OS and version: Windows 10 Pro 1803
- Python version (& distribution if applicable, e.g. Anaconda): Python 3.7.0 x64
- Type of virtual environment used (N/A | venv | virtualenv | conda | …): virtualenv
- Relevant/affected Python packages and their versions: Django 2.1@master branch
Actual behavior
Computer runs slowly.
Expected behavior
Computer works at a reasonable speed and doesn’t get hot and slow and waste away my SSD.
Steps to reproduce:
- Open up VSCode and open up a .py file from the django project
Logs
Output for Python
in the Output
panel (View
→Output
, change the drop-down the upper-right of the Output
panel to Python
)
Starting Microsoft Python language server.
Microsoft Python Language Server version 0.1.42.0
Initializing for C:\Users\CarlFarrington\envs\hrr\Scripts\python.exe
##########Linting Output - pylint##########
************* Module riskreg.serializers
21,0,convention,C0304:Final newline missing
1,0,convention,C0111:Missing module docstring
5,0,convention,C0111:Missing class docstring
16,0,convention,C0111:Missing class docstring
3,0,warning,W0611:Unused Agent imported from models
3,0,warning,W0611:Unused Owner imported from models
3,0,warning,W0611:Unused Ownergroup imported from models
------------------------------------------------------------------
Your code has been rated at 5.00/10 (previous run: 5.00/10, +0.00)
Output from Console
under the Developer Tools
panel (toggle Developer Tools on under Help
)
/C:/Program Files/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:1410 INFO no standard startup: not just one text editor
/C:/Program Files/Microsoft VS Code Insiders/resources/app/out/vs/workbench/workbench.main.js:280 [Extension Host] Python Extension: Get language server folder name, , Return Value: "languageServer.0.1.42" (at Logger.logInformation (C:\Users\CarlFarrington\.vscode-insiders\extensions\ms-python.python-2018.9.0\out\client\common\logger.js:35:21))
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:26 (9 by maintainers)
Top GitHub Comments
This should be fixed via Microsoft/python-language-server#280 (reported Microsoft/python-language-server#278).
It’s not in the stable release channel yet, but you can pull our latest language server daily build by setting
"python.analysis.downloadChannel": "daily"
in your settings JSON and reloading. Note that this is undocumented and for testing only. There may be other bugs in our daily builds which don’t appear in stable. You may need to delete thelanguageServer
directories in the Python extension folder to return to the stable build after trying it out, as the extension will always select the newest downloaded version to start.I’ve followed debugging tips for getting the latest language server:
Language Server Version: 0.1.62
I’m still seeing 1 CPU pegged at 100%, and RAM constantly climbing. After looking at AnalysisLog.txt in the language server directory of the extension, I’m seeing thousands of lines like this:
I thought this might have something to do with the root paths (because the final component of the import path above was missing in previous language server version logs - (after) ge.tests.ge -> ge.tests (before)).
My project is
workspace/kogan3/
with myworkspace/kogan3/apps
directory added as a top level import by inserting it into sys.path from manage.py. I tell vscode-python about this like so:I should note this is a python2.7 project, and I’m guessing the weird imports are due to
absolute import
differences, but I’m just guessing at this stage.Since AnalysisLog was constantly being written to, I figured this might be the cause for my 100% cpu, but I didn’t know whether it was the use of the language server from the extension, or the server itself. Happy to repost over on the language server repo.
In fact, my cpu usage has just dropped down to a reasonable level (near 0 while I’m not actively using the editor) after the update to the latest server. It was pegged at 100% for over 10 minutes though.