Skip to content

Python Language Server uses too much CPU #3557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
VelizarVESSELINOV opened this issue Dec 4, 2018 · 10 comments
Closed

Python Language Server uses too much CPU #3557

VelizarVESSELINOV opened this issue Dec 4, 2018 · 10 comments
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug

Comments

@VelizarVESSELINOV
Copy link

VelizarVESSELINOV commented Dec 4, 2018

Environment data

  • VS Code version: 1.29.1
  • Extension version (available under the Extensions sidebar): 2018.11.0
  • OS and version: macOS Mojave 10.14.1
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3, Python 2...
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
  • Relevant/affected Python packages and their versions: N/A

Expected behaviour

< 1% CPU

Actual behaviour

> 99% CPU

image

image

image

image

image

Steps to reproduce:

  1. Install several versions of Python
  2. Run VS Code

Logs

Output for Python in the Output panel (ViewOutput, 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.65.0
Initializing for /usr/local/bin/python3
@brettcannon brettcannon self-assigned this Dec 5, 2018
@brettcannon brettcannon added info-needed Issue requires more information from poster triage labels Dec 5, 2018
@brettcannon
Copy link
Member

Do you have "python.autoComplete.extraPaths" defined?

@PushUpek
Copy link

PushUpek commented Dec 6, 2018

I have the same issue, but only with python2

@VelizarVESSELINOV
Copy link
Author

@brettcannon only in the default user settings defined as []

@VelizarVESSELINOV
Copy link
Author

It is the biggest CPU consumer of all the processes: >21 hours

image

Side comment that maybe it is the case of @PushUpek I have a lot of files and folders in my current folder that is not Python code or libraries, questioning if Microsoft Python Server is not trying to parse GiB of data continuously in the current folder of VS Code project.

@jonaswitt
Copy link

+1 - I have the same problem with

VS Code 1.29.1
Microsoft Python Language Server version 0.1.65.0
Python Extension 2018.11.0
Python 2.7.15 (venv-based environment)

My python.autoComplete.extraPaths setting is also []. I tried to disable Jedi and Linting. I keep killing the process to keep my Macbook's fans from spinning, but it always respawns at 100% CPU usage.

Is there any way to disable the language server? I believe my only option right now is to disable the python extension completely.

@dwt
Copy link

dwt commented Dec 10, 2018

This happens for me too. Python 2.7 with a moderately big project. What Info can I provide to help debug this?

@brettcannon
Copy link
Member

I have moved this issue over to the python-language-server repo. Please report details/issues there.

@brettcannon brettcannon added area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. upstream-language server and removed info-needed Issue requires more information from poster triage labels Dec 11, 2018
@microsoft microsoft locked and limited conversation to collaborators Dec 11, 2018
@brettcannon brettcannon removed their assignment Dec 11, 2018
@qubitron
Copy link

@brettcannon is this different than #2838?

@brettcannon
Copy link
Member

@qubitron not sure, hence why I'm playing it safe and just reporting it up to python-language-server to decide if it's somehow different.

@brettcannon brettcannon added the bug Issue identified by VS Code Team member as probable bug label Jun 3, 2019
@luabud
Copy link
Member

luabud commented Sep 11, 2019

Closing in favour of microsoft/python-language-server#479

@luabud luabud closed this as completed Sep 11, 2019
@ghost ghost removed the needs upstream fix label Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

7 participants