Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio 2019 unterminating background processes - high cpu use, lag

In the most recent version of VS 2019 now 16.3.8 but have had the same issue with other release (16.3.7, 16.3.6, 16.3.5) I am finding that after a number of hours of use I have a number of background processes (visible in the small icon at the bottom left of the screen) that never terminate. It doesn't say much about them just "background processes" and the number of the them steadily increases until at anything above 5 VS becomes unusably slow with a high degree of lag on any operation, even typing (not very "background" then).

There are a few posts online of people describing the same problem but no solution presented has helped; eg I have found that if I delete the vs directory, the processes go away but sure enough they return a few hours later or sometimes quicker. Another suggestion was to delete all temp files but no improvement. I have registered an issue with MS but who knows if they'll ever respond (why do we pay a licence fee??). Has anyone else experienced this and know of any solution?

As its stands the issue became so annoying I have reverted back to 2017 which doesn't have the problem.

Icon at bottom left: enter image description here

When I click this it says "Running low priority background tasks" and a count which steadily increases. No more information than that.

enter image description here

Ive left VS running for a long time and they never seem to finish.

I've disabled every extension I have installed but no difference

if anyone else experiencing then please upvote my support query with microsoft to get it up the priority list https://developercommunity.visualstudio.com/content/problem/782552/high-cpu-usage-16.html

like image 644
Tim Rutter Avatar asked Oct 30 '19 15:10

Tim Rutter


2 Answers

I have found a half solution to this from msdn. However, its worth noting that the problem has resurfaced in a slightly different form. The below may help some people however.

https://developercommunity.visualstudio.com/content/problem/672009/live-analysis-eats-up-memory-resulting-in-vs-crash.html?childToView=858720#comment-858720

which has the following post:

As a workaround, add a rulset with the following contents:

<?xml version="1.0" encoding="utf-8"?>
<RuleSet Name="MyRules" Description="My Rules" ToolsVersion="16.0">
  <Rules AnalyzerId="Microsoft.CodeAnalysis.Features" RuleNamespace="Microsoft.CodeAnalysis.Features">
    <Rule Id="IDE0067" Action="None" />
    <Rule Id="IDE0068" Action="None" />
    <Rule Id="IDE0069" Action="None" />
  </Rules>
</RuleSet>

You can add the ruleset to your project/solution as follows:

https://learn.microsoft.com/en-us/visualstudio/code-quality/using-rule-sets-to-group-code-analysis-rules?view=vs-2019#specify-a-rule-set-for-a-project

like image 129
Tim Rutter Avatar answered Nov 15 '22 15:11

Tim Rutter


I also had this issue, and was causing my builds to take way longer than it did in previous versions. The tasks seem to just never complete which then led me to believe it was a privilege issue. I suggest finding your devenv.exe

usually located at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE

Right click and open as administrator, then open your solution project.

this actually fixed my issue.

like image 2
Jkurs Avatar answered Nov 15 '22 14:11

Jkurs