Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

high Memory Usage (again) #2007

Open
cottrell opened this issue Apr 25, 2020 · 19 comments
Open

high Memory Usage (again) #2007

cottrell opened this issue Apr 25, 2020 · 19 comments
Labels
question A question about the LS

Comments

@cottrell
Copy link

Is this high memory usage expected? Is vscode collecting informatino about this? I feel like I've filled out quite a few feedback surveys. Is there something to switch to for python? Main thing we need is click through to definition.

image

@cottrell cottrell added the question A question about the LS label Apr 25, 2020
@MikhailArkhipov
Copy link

There should not be that many instances unless you have multiroot workspace with that many roots.

@jakebailey
Copy link
Member

jakebailey commented Apr 25, 2020

The screenshot is from htop with threads shown (green lines); the above are threads of the same process.

@cottrell
Copy link
Author

Yes, I should have mentioned that. There is only one process but with many threads (which I am not worried about). It's about 12G virtual and over 5G resident. It could be just that it is traversing many python librariers. But the way I use vscode this will always happen if it goes deep enough into my library. I'm guessing it is building some kind of index on the fly without spilling anything to disk? I'm not quit clear on what it would be holding in memory that is beyond what a normal IPython session would hold (which I also run important much of the same code).

@jakebailey
Copy link
Member

You used the question form; our bug form asks for a bunch more info that we'd need to figure out anything about what's going on. I suggest providing that info, which is mirrored here: https://github.com/microsoft/python-language-server/blob/master/TROUBLESHOOTING.md#filing-an-issue

@MikhailArkhipov
Copy link

Still a bit odd there are that many threads unless analysis is still in progress and even then it should be limited to number of CPUs.

@jakebailey
Copy link
Member

As far as I know, this has sorta been the case for a while. For example, see the screenshot in #1755. IIRC we only limit the number of tasks, and to a multiple of the CPU count, but I don't think we're directly limiting the thread count anywhere unless I've missed something.

@CMLL
Copy link

CMLL commented Apr 27, 2020

The screens in that issue are from an issue I currently have with a couple of files that seems related to a circular import going on between the 2 of them. If I open other project or other files in the same project the LS never goes extremely high in memory usage or thread count, but opening these files, there are 3 of them haven't been able to determine if is a combination of them or simply one of them, makes my memory go high, thread count to spike, LS to become not responsive and sticks around after I close the VSCode client until I forcefully kill it.

@jakebailey
Copy link
Member

Right; I was just referring to the htop screenshot, not necessarily that they're related.

@CMLL
Copy link

CMLL commented Apr 27, 2020

From the issue screenshot and what I see on my end it could def be related. But that's just a theory.

@MikhailArkhipov
Copy link

#1460 ?

@WilliamStone
Copy link

1

Memory leak.

  • PC physical memory is 32G.
  • never explicitly opened any .py file in VSCode since windows restart.
  • VSCode opened for a few days.
  • This memory leak is first time to appear in my PC.

System: Windows10 2004
VSCode About Information:

Version: 1.46.0-insider (user setup)
Commit: 2591ede95a52400d5d22989b16706f9b8b4831da
Date: 2020-05-22T21:13:15.709Z
Electron: 8.3.0
Chrome: 80.0.3987.165
Node.js: 12.13.0
V8: 8.0.426.27-electron.0
OS: Windows_NT x64 10.0.19635

@koliyo
Copy link

koliyo commented Jun 10, 2020

I have similar experience. Definitely some kind of leak. Leaving an VS Code session open, but untouched over night or after some days can cause the whole computer to become unresponsive.

Running on Mac OS
We have a large Python API wrapped around C++ code using SWIG.

No problem with fresh VS Code session, but deteriorates over time.

Have verified multiple occasions that Microsoft.Python.LanguageServer is what is eating all the memory.

@MikhailArkhipov
Copy link

Try

"python.analysis.downloadChannel": "beta"

see of 0.5.51 is any better.

@CMLL
Copy link

CMLL commented Jun 26, 2020

I've been using the daily channel for some time. 0.5.51 doesn't seems to have any positive impact on the issue for me.

@vj68
Copy link

vj68 commented Jul 15, 2020

On Ubuntu 18.04 also

ms-python-lang-serv-mem-usage

@jakebailey
Copy link
Member

I would consider trying out our new LS, Pylance, to see if its performance characteristics work better for you.

@mw-cyzen
Copy link

Try

"python.analysis.downloadChannel": "beta"

see of 0.5.51 is any better.

5.51 isnt any better. running on Ubuntu 18.04.3 LTS its eating my entire virtual memory space in under an hour ( 36gb ) it sits on "analyzing in background"

how do i disable?

@MikhailArkhipov
Copy link

You can try Pylance server instead. It is an extension on marketplace.

@mw-cyzen
Copy link

You can try Pylance server instead. It is an extension on marketplace.

ty, works as expected

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question A question about the LS
Projects
None yet
Development

No branches or pull requests

8 participants