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

Huge CPU and Memory consumption caused by design problems #4952

Closed
suiahae opened this issue Mar 27, 2019 · 12 comments
Closed

Huge CPU and Memory consumption caused by design problems #4952

suiahae opened this issue Mar 27, 2019 · 12 comments

Comments

@suiahae
Copy link

suiahae commented Mar 27, 2019

Issue Type: Bug

Some questions about the python plugin encountered when building python library indexes

I strongly hope that the python plugin does not read the information into memory in real time when creating the python library index, but instead saves the index file in order to speed up the time and reduce memory overhead.

The python library is really too big. Sometimes I have to wait a few minutes for writing a small amount of code.

Extension version: 2019.3.6139
VS Code version: Code 1.32.3 (a3db5be9b5c6ba46bb7555ec5d60178ecc2eaae4, 2019-03-14T23:43:35.476Z)
OS version: Windows_NT x64 10.0.17763

System Info
Item Value
CPUs Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz (4 x 2712)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 15.86GB (8.60GB free)
Process Argv
Screen Reader no
VM 46%
@ghost ghost added the triage-needed Needs assignment to the proper sub-team label Mar 27, 2019
@suiahae suiahae changed the title Huge CPU and Memory consumption caused by design problems soared Huge CPU and Memory consumption caused by design problems Mar 27, 2019
@algo99
Copy link

algo99 commented Mar 27, 2019

I can confirm, on Windows 10.

After update (yesterday) of Python Language Server and/or vscode_python extension VSCode not more usable. See the disk I/O and memory consumption:

vscode_python_language_server

The extension proceeds after VSCode start:

Analyzing in background, 6879 items left ...

and this process does not stop.
I tried several times to restart VSCode, but it does not help.

@algo99
Copy link

algo99 commented Mar 27, 2019

Just noted in Python output pane:

...
[Info  - 09:17:10] Microsoft Python Language Server version 0.2.31.0
[Info  - 09:17:10] Initializing for c:\3rd\WinPython\python-3.7.2.amd64\python.exe
Traceback (most recent call last):
  File "C:\Users\zkr\.vscode\extensions\ms-python.python-2019.3.6139\languageServer.0.2.31\scrape_module.py", line 1497, in <module>
    state.collect_second_level_members()
  File "C:\Users\zkr\.vscode\extensions\ms-python.python-2019.3.6139\languageServer.0.2.31\scrape_module.py", line 944, in collect_second_level_members
    self._collect_members(mi.value, mi.members, substitutes, mi)
  File "C:\Users\zkr\.vscode\extensions\ms-python.python-2019.3.6139\languageServer.0.2.31\scrape_module.py", line 958, in _collect_members
    raise RuntimeError("failed to import module")
RuntimeError: failed to import module
Traceback (most recent call last):
  File "C:\Users\zkr\.vscode\extensions\ms-python.python-2019.3.6139\languageServer.0.2.31\scrape_module.py", line 1497, in <module>
    state.collect_second_level_members()
  File "C:\Users\zkr\.vscode\extensions\ms-python.python-2019.3.6139\languageServer.0.2.31\scrape_module.py", line 944, in collect_second_level_members
    self._collect_members(mi.value, mi.members, substitutes, mi)
  File "C:\Users\zkr\.vscode\extensions\ms-python.python-2019.3.6139\languageServer.0.2.31\scrape_module.py", line 958, in _collect_members
    raise RuntimeError("failed to import module")
RuntimeError: failed to import module
Traceback (most recent call last):
  File "C:\Users\zkr\.vscode\extensions\ms-python.python-2019.3.6139\languageServer.0.2.31\scrape_module.py", line 1489, in <module>
    state.initial_import(sys.argv[2])
  File "C:\Users\zkr\.vscode\extensions\ms-python.python-2019.3.6139\languageServer.0.2.31\scrape_module.py", line 872, in initial_import
    mod = __import__(self.module_name)
  File "c:\3rd\winpython\python-3.7.2.amd64\lib\site-packages\cvxopt\__init__.py", line 50, in <module>
    import cvxopt.base
ImportError: DLL load failed: Das angegebene Modul wurde nicht gefunden.

@dilzeem
Copy link

dilzeem commented Mar 27, 2019

I am also getting the same issue as well on Windows 10.

It only happens once I start debugging some code.
It renders VScode unusable.

@suiahae
Copy link
Author

suiahae commented Mar 27, 2019

It only happens when the python plugin loads the python library, which requires a lot of CPU and memory. And these information that is loaded into memory is estimated to be used for IntelliCode.

@ray306
Copy link

ray306 commented Mar 27, 2019

The same problem happens today. I think it's a bug of new Python plugin just released yesterday (March 26).

@dilzeem
Copy link

dilzeem commented Mar 27, 2019

Possibly a duplicate of of this in the python language server:

microsoft/python-language-server#450

@suiahae
Copy link
Author

suiahae commented Mar 27, 2019

Possibly a duplicate of of this in the python language server:

Microsoft/python-language-server#450

I also think that the issues area of the python plugin has a large part of similar content related to such a bug. It seems that this bug is very disturbing programming and needs to be solved urgently. ;-)

@gramster
Copy link
Member

Please add further reports and repro cases to microsoft/python-language-server#832

@nbara
Copy link

nbara commented Mar 28, 2019

Can you kindly provide instructions to downgrade extension/language-server version until this is fixed ? This issue makes VSCode completely unusable for me as it is...

@gramster
Copy link
Member

gramster commented Mar 28, 2019 via email

@suiahae
Copy link
Author

suiahae commented Mar 28, 2019

Thanks. The temporary solution you provided perfectly solved my problem. The huge memory consumption disappeared when I switched to jedi by setting jediEnabled to true in the settings.

So, I think the “culprit” should be Microsoft.Python.LanguageServer.exe(or the design flaw of Microsoft.Python.LanguageServer.exe).

And I have a question that does Microsoft's analysis tool be added or is it set to be enabled by default in the new version in March?

You can switch to jedi by setting jediEnabled to true in the settings.

On Thu, Mar 28, 2019 at 2:41 AM Nicolas Barascud @.***> wrote: Can you kindly provide instructions to downgrade extension/language-server version until this is fixed ? This issue makes VSCode completely unusable for me as it is... — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#4952 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AConiM84H37g6mJ2jYG3bd_3O1IZNwWZks5vbI4xgaJpZM4cM9GU .

@DonJayamanne
Copy link

DonJayamanne commented Apr 1, 2019

Closing in favor of microsoft/python-language-server#832

@ghost ghost removed the needs upstream fix label Apr 1, 2019
@microsoft microsoft locked and limited conversation to collaborators Apr 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants