You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
The fixed implemented in #832 worked for some releases, but I'm having again high memory usage problems (10gb+) with version 0.3.20
These seems to be due to a memory leak: if finishes analyzing the project without problems, using less than 1gb in my case. After working on the project for some time it starts using more memory, even more than 10gb+.
I've not kept note of the details regarding after how long or if there is an action that triggers it. I usually notice a slow down, check the task manager and usually the language service is using many gb of memory. I have not kept track to see it the increase in memory usage is sudden or more gradual.
Below are the packages of the project used and some system information. I haven't checked if I can reproduce this issue in other projects
Is there some logging or telemetry I can enable to help with this issue?
Extension version: 2019.6.22090
Microsoft Python Language Server version 0.3.20.0
Python version: 3.6.8
VS Code version: Code 1.36.0 (0f3794b38477eea13fb47fbe15a42798e6129338, 2019-07-03T13:25:46.372Z)
OS version: Windows_NT x64 10.0.18362
Sorry I should have clarified.
I usually notice the issue after 1-4h of the last reload of vscode or kill of the language service.
But I'm estimating here, I have not traked it precisely
I've checked and I still had vscode open after today. Attached is the log from the python output. vscode python log.txt
I've killed it at 12, 15:30, then later this evening when I resumed the pc from sleep
We just built 0.3.22, which is available in the beta/daily channels. It contains some fixes which we believe will help solve some of the leaks. You can set this and reload to update:
Attached is a pip freeze of the current environment.
I use conda to manage the environments, but I've used pip to install the packages, so all should be there pip freeze.txt
On 0.3.46 the leaking behavior seems to be solved. Now, the LS reaches around 1GB while analyzing the files, and after it, it drops to around 400 MB. Multiple pip install of the project do not accumulate memory as before, getting exactly the same memory behavior every install cycle.
Sorry for the long absence, but I've been on holiday and then had to work on another project for a bit.
This week I've returned to work to the project that has been causing problems, and I still have large memory issues.
This is a dump from Microsoft Python Language Server version 0.3.72.0 with a size of ~6gb dupheap stas.5.9gb.txt
I'm not been tracking its memory usage but I've noticed that sometimes its memory usage decreases: a few minutes before dumping the memory to collect the stats the language server was using ~8gb, so some progress there seems to have happened.
Hope it helps. I can track its memory usage it may help
I'm currently working on the sqlalchemy library so I have it installed in editable mode with pip (pip install -e . in the sqlalchemy folder) and after about 1h of working on it, mainly navigating between classes, the language server is at about 4.3 GB or used ram. I'm on Version 0.4.71.0
I was using sqlalchemy also on my original project. I still cannot trigger it on demand, but at least this is now happening on an open source project, so it may be easier to reproduce
I'm using a env only for this, so the packages installed are not that many (sadly I had jupyterlab installed in the same env, so this increases the number of packages, but I'm not using it or referencing it in the project):
Since about version 0.5 I don't seem to notice overly large memory usage, sometimes I've seen a couple of GB, but I have not had to kill the language server for it. I'm not monitoring it closely though
I'm not sure if the underling issue has been solved or not, but I think this can be closed for now. If I notice again the same high usage I'll reopen this (or a new one)
Activity
AlexanderSher commentedon Jul 9, 2019
How much time have you used it?
CaselIT commentedon Jul 9, 2019
Sorry I should have clarified.
I usually notice the issue after 1-4h of the last reload of vscode or kill of the language service.
But I'm estimating here, I have not traked it precisely
CaselIT commentedon Jul 9, 2019
I've checked and I still had vscode open after today. Attached is the log from the python output.
vscode python log.txt
I've killed it at 12, 15:30, then later this evening when I resumed the pc from sleep
AlexanderSher commentedon Jul 9, 2019
Ok, thank you!
jakebailey commentedon Jul 9, 2019
We just built 0.3.22, which is available in the beta/daily channels. It contains some fixes which we believe will help solve some of the leaks. You can set this and reload to update:
CaselIT commentedon Jul 10, 2019
I'll try it and report back. Thanks for the quick feedback 👍
CaselIT commentedon Jul 10, 2019
I still have the same problem with the 0.3.22.

This is after about 1h of work.
Reinstalling the extension or deleting the folder of the language server may help?
CaselIT commentedon Jul 10, 2019
I've logged the memory usage with the performance monitor and this is the graph (in MB)
[-]High memory usage in 0.3.20 (memory leak?)[/-][+]High memory usage in 0.3.22 (memory leak?)[/+]AlexanderSher commentedon Jul 11, 2019
Federico Caselli (@CaselIT) , If you have a venv, can you create
requirements.txtand attach it to the bug?CaselIT commentedon Jul 11, 2019
Attached is a pip freeze of the current environment.
I use conda to manage the environments, but I've used pip to install the packages, so all should be there
pip freeze.txt
elinsky commentedon Jul 12, 2019
I'm noticing the same memory issue. I'll leave VS Code running for about 1hr and it will end up using 10gb of RAM.
OS Version: Version Windows 10.0.18362.175
Python Version: 2.7.16
VS Code version: 1.36.1
jakebailey commentedon Jul 12, 2019
Please try the daily build, which has a few more fixes (mainly #1316).
Currently 0.3.28.
53 remaining items
juliotux commentedon Aug 10, 2019
On 0.3.46 the leaking behavior seems to be solved. Now, the LS reaches around 1GB while analyzing the files, and after it, it drops to around 400 MB. Multiple
pip installof the project do not accumulate memory as before, getting exactly the same memory behavior every install cycle.CaselIT commentedon Sep 4, 2019
Sorry for the long absence, but I've been on holiday and then had to work on another project for a bit.
This week I've returned to work to the project that has been causing problems, and I still have large memory issues.
This is a dump from
Microsoft Python Language Server version 0.3.72.0with a size of ~6gbdupheap stas.5.9gb.txt
I'm not been tracking its memory usage but I've noticed that sometimes its memory usage decreases: a few minutes before dumping the memory to collect the stats the language server was using ~8gb, so some progress there seems to have happened.
Hope it helps. I can track its memory usage it may help
CaselIT commentedon Oct 19, 2019
Just a follow up.
I'm currently working on the sqlalchemy library so I have it installed in editable mode with pip (
pip install -e .in the sqlalchemy folder) and after about 1h of working on it, mainly navigating between classes, the language server is at about 4.3 GB or used ram. I'm on Version 0.4.71.0I was using sqlalchemy also on my original project. I still cannot trigger it on demand, but at least this is now happening on an open source project, so it may be easier to reproduce
I'm using a env only for this, so the packages installed are not that many (sadly I had jupyterlab installed in the same env, so this increases the number of packages, but I'm not using it or referencing it in the project):
Packages
I'll try recreating the env with only sqlalchemy and its dependencies to check if the problem persists
MikhailArkhipov commentedon Dec 16, 2019
Cloning and opening
sqlalchemyas a workspace yielded ~500MB RAM consumption. This is 0.5.10CaselIT commentedon Dec 16, 2019
Since about version 0.5 I don't seem to notice overly large memory usage, sometimes I've seen a couple of GB, but I have not had to kill the language server for it. I'm not monitoring it closely though
I'm not sure if the underling issue has been solved or not, but I think this can be closed for now. If I notice again the same high usage I'll reopen this (or a new one)
MikhailArkhipov commentedon Dec 16, 2019
Thanks! 2GB is high-ish, but with large libraries sometimes happens during peak consumption which should be released when analysis is done.
CaselIT commentedon Dec 16, 2019
Thanks for the improvements you and your team have doing to the language server 👍