Skip to content
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

Dozens of python processes started (after update to 2018.11.0) #3514

Closed
FreeHarry opened this issue Nov 30, 2018 · 17 comments
Closed

Dozens of python processes started (after update to 2018.11.0) #3514

FreeHarry opened this issue Nov 30, 2018 · 17 comments
Assignees
Labels
area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. bug Issue identified by VS Code Team member as probable bug

Comments

@FreeHarry
Copy link

Environment data

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

Actual behavior

Since update to 2018.11.0 after some minutes of work dozens of python processes are started. Currently ~150 processes and 4.5 GB of memory is used!!

It seems each time I switch to another python file tab or change and save a python file a new python process is started. Very strange.

@FreeHarry
Copy link
Author

I test it currently also on my Linux machine (Fedora 29). The same problem occurs.

@syegulalp
Copy link

I'm experiencing something similar. When opening Python files in a project, new instances of Python are started in the background but don't close unless I close and reopen the folder (using File | Close Folder).

@syegulalp
Copy link

The problem seems related to the use of jedi. When I disabled that and reverted to the MS Language Server, the problem ceased.

@DonJayamanne
Copy link

@Nutznieser

Since update to 2018.11.0 after some minutes of work dozens of python processes are started. Currently ~150 processes and 4.5 GB of memory is used!!

Please could you send a screen shot of the processes spawned along with the arguments passed to the processes.

@DonJayamanne DonJayamanne self-assigned this Nov 30, 2018
@DonJayamanne DonJayamanne added bug Issue identified by VS Code Team member as probable bug triage labels Nov 30, 2018
@omouri
Copy link

omouri commented Nov 30, 2018

The problem seems related to the use of jedi. When I disabled that and reverted to the MS Language Server, the problem ceased.

For me it was the opposite. I was seeing huge amounts of RAM being used by Microsoft.Python.LanguageServer. When I ENABLED Jedi I stopped seeing the issue.

@DonJayamanne
Copy link

For me it was the opposite. I was seeing huge amounts of RAM being used by Microsoft.Python.LanguageServer. When I ENABLED Jedi I stopped seeing the issue.

Please could you create a separate issue for this

@IVNSTN
Copy link

IVNSTN commented Nov 30, 2018

Ubuntu 17.10

vs code:

Version: 1.29.1
Commit: bc24f98b5f70467bc689abf41cc5550ca637088e
Date: 2018-11-15T19:07:43.495Z
Electron: 2.0.12
Chrome: 61.0.3163.100
Node.js: 8.9.3
V8: 6.1.534.41
Architecture: x64

image

Number of processes raises while editing code in VS Code until consumes all memory.
All of them are gone after Code shutdown.
Disabling Jedi intellisense fixes the issue but linter starts failing on every import and intellisense does not work at all.

@FreeHarry
Copy link
Author

Here is a screen shot from the internal process explorer. Very similar to that from @IVNSTN.

processes-view

@WhistleWhileYouWork
Copy link

I can also confirm this behavior. It happens during code completion. Every time you start typing, a conhost.exe process launches python.exe with the jedi script indicated in the comment above. After disabling jedi in the settings and reloading, the number of processes remain stable.

@2-5
Copy link

2-5 commented Dec 2, 2018

  • Version: 1.29.1 (system setup)
  • Commit: bc24f98b5f70467bc689abf41cc5550ca637088e
  • Date: 2018-11-15T19:13:36.375Z
  • Electron: 2.0.12
  • Chrome: 61.0.3163.100
  • Node.js: 8.9.3
  • V8: 6.1.534.41
  • Architecture: x64

Windows 10

Same problem, after working for a few hours hundreds of python Jedi processes are running, consuming in total 5 GB even if I've set "python.jediMemoryLimit": 128. These processes seem to never exit, even if I close all open Python files in Code.

Exiting VS Code causes the whole computer to freeze for 5 seconds, even the mouse is lagging, probably because all of these Python processes need to be terminated. I have a fast SSD.

The command line for the Python Jedi processes is:

...\python.exe c:\Users\USER\.vscode\extensions\ms-python.python-2018.11.0\pythonFiles\jedi\evaluate\compiled\subprocess\__main__.py c:\Users\USER\.vscode\extensions\ms-python.python-2018.11.0\pythonFiles 3.6.4

@DelBiss
Copy link

DelBiss commented Dec 3, 2018

For me, it happen with python refactor.py AND jedi
When looking with the VS Code process explorer, on both case, all process had a child console-window-host (Windows internal process)

With python refactor.py the issue happen when there is a syntax error in the user file when the user try to refactor a variable.

Code example that will create this issues:

VariableToRefactor = "RefactorMe"
foo = "another"
syntaxError = "This is an error
VariableToRefactor = "Something"

VS Code process explorer:

Mem(MB)	pid	Name
57	7592	code main
54	11376	     shared-process
228	12820	     window (file.py - project - Visual Studio Code)
78	6624	         extensionHost
14	5608	             python refactor.py c:\Users\USER\workspace\project
9	11600	                 console-window-host (Windows internal process)
4	13036	             "C:\Users\USER\AppData\Local\Programs\Microsoft VS Code\Code.exe" "c:\Users\USER\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\html-language-features\server\dist\htmlServerMain" --node-ipc --clientProcessId=6624
14	14272	             python refactor.py c:\Users\USER\workspace\project
9	576	                 console-window-host (Windows internal process)
4	21084	             electron_node server.js 
14	22296	             python refactor.py c:\Users\USER\workspace\project
9	44976	                 console-window-host (Windows internal process)
7	32560	             "C:\Users\USER\AppData\Local\Programs\Microsoft VS Code\Code.exe" "c:\Users\USER\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\json-language-features\server\dist\jsonServerMain" --node-ipc --clientProcessId=6624
14	44524	             python refactor.py c:\Users\USER\workspace\project
9	22740	                 console-window-host (Windows internal process)
3	7828	         electron-crash-reporter
6	13076	         watcherService 
2	1716	             console-window-host (Windows internal process)
54	34744	     gpu-process
142	43124	     window (Process Explorer)

@StdioA
Copy link

StdioA commented Dec 4, 2018

Same on macOS

Every time I use auto completion will create a new Python process, too many of them results in fork failed.

  • VS Code version: 1.29.1
  • Extension version (available under the Extensions sidebar): 2018.11.0
  • OS and version: macOS High Sierra 10.13.6
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.0, homebrew
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): No

@anwyho
Copy link

anwyho commented Dec 4, 2018

Similar on macOS Mojave as well.

  • VS Code version: 1.27.2

  • Extension version (available under the Extensions sidebar): 2018-09-12

  • OS and version: macOS Mojave 10.14.1

  • Python version (& distribution if applicable, e.g. Anaconda): 3.6.5, homebrew

  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A and virtualenvwrapper

  • Misc: Jedi-Enabled
    On attempted exit, sometimes many python and Code Helper processes are created and eat up memory/cpu. As a result, I need to force exit while pushing through lag.
    I began experiencing this every time I closed VS Code after running Python 3.6.5 programs and coding for at least an hour. (It has happened four times.)
    I only started experiencing this problem yesterday, and I use VS Code with Python every other day at least if not daily.

Edit: clarify that VS Code does not exit for me until force exit

@Arpafaucon
Copy link

Similar on Ubuntu Linux 18.04

  • VS code version 1.29.1 (bc24f98b5f70467bc689abf41cc5550ca637088e)
  • extension: ms-python.python@2018.11.0
  • OS : Ubuntu 18.04
  • python3 version 3.6.6

After coding in python for more than 10 minutes, I notice a lot of spawned process. The RAM is eventually completely eaten, and the PC freezes.

process CL :

usr/bin/python3 /home/arpad/.vscode/extensions/ms-python.python-2018.11.0/pythonFiles/jedi/evaluate/compiled/subprocess/__main__.py /home/arpad/.vscode/extensions/ms-python.python-2018.11.0/pythonFiles 3.6.6

@dethos
Copy link

dethos commented Dec 4, 2018

I can confirm this issue happens on Linux as well. It froze my computer a couple of times today.

Lots of processes are like this:

/home/user/.virtualenvs/project_one/bin/python /home/user/.vscode/extensions/ms-python.python-2018.11.0/pythonFiles/jedi/evaluate/compiled/subprocess/__main__.py /home/user/.vscode/extensions/ms-python.python-2018.11.0/pythonFiles 3.6.7

are created in a very short time.

@brettcannon brettcannon added area-intellisense LSP-related functionality: auto-complete, docstrings, navigation, refactoring, etc. needs PR important Issue identified as high-priority and removed triage labels Dec 5, 2018
@brettcannon
Copy link
Member

This has been reported upstream at davidhalter/jedi#1256 . We will look to revert back to Jedi 0.12 in our next release (currently targetting next week).

@edugarcam
Copy link

edugarcam commented Dec 13, 2018

Same problem over Archlinux. Hundreds of process for /usr/bin/python2 jedi/evaluate/compiled/subprocess/__main__.py 2.7.15

@microsoft microsoft locked as resolved and limited conversation to collaborators Dec 13, 2018
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