Ptvs: Python Background Analyzer Taking Up All My Memory

Created on 23 Apr 2019  Â·  16Comments  Â·  Source: microsoft/PTVS

While debugging/running some basic Unit Tests using the Python Mock Library, I keep running into this issue where multiple Python Background Analyzer processes progressively consume all of my machine's available memory. See Task Manager screenshot below:

image

I'm currently running:
Microsoft Visual Studio Professional 2019 Version 16.0.2
ptvsd (4.2.8)

Some say that disabling and uninstalling unnecessary extensions may solve the issue, but it didn't seem to solve mine. Here is a screenshot of my enabled extensions:
image

I don't have any sort of recursive functions in my tests. The memory usage begins on Visual Studio startup, and increases at a high rate until I hit my memory and disk capacity. My current fix is to restart Visual Studio, which frees up the memory.

Please let me know if I can provide any sort of additional information, such as logs, to track down the issue.
I'd like to find a permanent solution, so any help would be greatly appreciated!

Code Intelligence Legacy Language Support bug language server

Most helpful comment

This happens to me also. My solution is large and multi-project also and I see several analyzers running in the background with HUGE memory allocations. Other simpler projects don't seem to have this problem.

It gets so bad that it eats all the memory of my machine and grinds it to a halt (massive paging). I now shut down Visual Studio when I go home for the day so that my computer isn't dead the next day.

Sorry but I also don't know how to reproduce it. Is there an option that I might turn on to collect info in a log file that I can then send you in lieu of my project files?

Thanks!

Andre

All 16 comments

Hi @yamen321

We would need a repro in order to investigate, unfortunately.

The language server team has rewritten the analysis code for their upcoming release, which can be beta tested in Visual Studio Code. I'd recommend giving that a try if possible. In general it is now much better than the previous version.

We're working on integrating the new language server into VS, but it's quite a bit of work, so it will take some time. What we're doing should avoid future recurring integration work (we've been through this for 16.0, but we went with the cheapest integration option, which we cannot do anymore due to their rewrite).

I don't know if that would be a helpful, but you have several analyzers running, probably because you have a multi project solution? If possible, merging them into a single project will reduce it to one analyzer, which might help a little.

Hey @huguesv

I really appreciate your detailed response! I'm unable to supply my project solution, but I definitely understand the difficulty of investigating without reproduction.

As you guessed, I do have 5 projects in my solution; however, I don't think I can merge them at this moment.

I'm sure integration has been tough, but do you happen to have a rough estimate of the time it will take to complete it? I'd just like to know if I'm looking at several months or more here. If that's the case, I'll probably just revert back to VS 2017 in the meantime.

Thanks again for your help!

It will be several months.

Our plan is to make use https://docs.microsoft.com/en-us/visualstudio/extensibility/adding-an-lsp-extension?view=vs-2019 but it doesn't quite fit our needs as is (we need it to work with project systems) so we need changes from extensibility team.

For sure, thanks a lot for the heads up!

I'm going to go back to VS 2017 in the meantime then. Good luck with the integration!

Is it possible to add an option to toggle off/on the Python Tools Analyzer? In the past, I was able to kill all the instances of the PTA, but now it re-spawns. I know that was changed due to a filed bug. I thought of being able to kill the PTA as feature. Being able to toggle it would be a great feature so that I could turn it back on when I really need it. Our sln has both Python and C++ projects.

This happens to me also. My solution is large and multi-project also and I see several analyzers running in the background with HUGE memory allocations. Other simpler projects don't seem to have this problem.

It gets so bad that it eats all the memory of my machine and grinds it to a halt (massive paging). I now shut down Visual Studio when I go home for the day so that my computer isn't dead the next day.

Sorry but I also don't know how to reproduce it. Is there an option that I might turn on to collect info in a log file that I can then send you in lieu of my project files?

Thanks!

Andre

Same problem here... 8 instances of python background analyzer keep cycling and saturate my CPUs.
I'm literally unable to continue working on our python project. Is there a way to disable background analyzer?

Same.
6 projects in solution -> 6 python backgrund analyzer processes running eating up all memory.
Patch for VS2019 would be highly appreciated here.

Same Here. Mixed solution with C++ and Python projects
Very high CPU utilization

@nextstate I saw another PR with an option to disable: https://github.com/microsoft/PTVS/issues/6181

How about "fix Intellisense" instead? :-)

On Sun, Aug 16, 2020 at 11:14 AM bengartner notifications@github.com
wrote:

@nextstate https://github.com/nextstate I saw another PR with an option
to disable: #6181 https://github.com/microsoft/PTVS/issues/6181

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/PTVS/issues/5250#issuecomment-674559076,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ALZ5OUATXRGAGNS2H2HB7DTSBAOYFANCNFSM4HH36EIA
.

Same issue here.
It's been almost a year an a half since @yamen321 first opened this issue.
Any update when the fix will be available?

Same issue

Same here aswel, I have three python projects and one of the python background analyzer just keep eating the memory (7-8gb of ram) when the program is left over night.
This makes it really tricky to remote desktop to the machine!

The upcoming Pylance LS integration should solve any cpu/memory issues. Watch this issue for updates.

5210

If you need something to reproduce with: https:/github.com/pymc-devs/Theano-PyMC

Was this page helpful?
0 / 5 - 0 ratings

Related issues

huguesv picture huguesv  Â·  4Comments

DmitrySokolov picture DmitrySokolov  Â·  5Comments

eugals picture eugals  Â·  6Comments

hermanocabral picture hermanocabral  Â·  5Comments

huguesv picture huguesv  Â·  3Comments