49

I have got brand new installation of VS2019 Community (release version) beside VS2017. When i load project to work on there is constantly about 30% of CPU is using on idle.

Project is completely loaded, analyzed and running on IIS Express. Project is small and running with no problems on VS2017 (C# + ASP.NET Core MVC)

enter image description here

Sam Alekseev
  • 2,281
  • 2
  • 19
  • 28
  • 1
    Is it idle? Or is it analyzing the source? How big is the project? How long did you wait for it to *finish* analyzing? – Panagiotis Kanavos Apr 03 '19 at 11:09
  • Are you sure you have the most up to date version? This seems to be a common problem with other users https://developercommunity.visualstudio.com/content/problem/400109/visual-studio-2019-preview-high-cpu-usage-in-idle.html – K.Madden Apr 03 '19 at 11:11
  • BTW I don't see this. I've opened a relatively small 5 project solution in VS 2019 for quite some time now, and CPU while I'm writing this comment is around 0% with 500MB memory usage. – Panagiotis Kanavos Apr 03 '19 at 11:11
  • Its brand new installation from MS website after official release today (not RC). Project is completely loaded, analyzed and running on IIS Express. Project is small and running with no problems on VS2017 (C# + ASP.NET Core MVC) – Sam Alekseev Apr 03 '19 at 11:14
  • `running on IIS Express.` so 30% is during debugging? What are the child processes doing? The linked issue isn't related to C# projects. – Panagiotis Kanavos Apr 03 '19 at 11:21
  • Pretty much a standard problem for any new VS release. You'll have to let your anti-malware product catch up with jiggabytes worth of suspicious new binaries, that always takes a long time. Easy to test, temporarily disable it. Few reasons to re-enable it btw, it is a solution in search of a real problem these days. – Hans Passant Apr 03 '19 at 13:06
  • analyze [CPU usage with Windows Performance Toolkit](https://stackoverflow.com/a/44137653/1466046) – magicandre1981 Apr 03 '19 at 14:28
  • Deleting .vs and .git file will works (.vs and .git file will be on C:\Users\All Users) These files are hidden. Enable show hidden files. As it works on mine. I found this answer from https://developercommunity.visualstudio.com/content/problem/116300/git-for-windows-high-cpu-during-build.html – sophin Oct 21 '20 at 00:50
  • I've been having much the same problem. Using SysInternals, I discovered that a thread spawned by devenv, IsAssertEtwWaiting, is gobbling up 10% to 15% of the CPU cycles, and stays that way for as long as 15 minutes! What's a developer to do? – EoRaptor013 Apr 08 '21 at 01:19

11 Answers11

28

I had the same problem as you today. Fresh Visual Studio 2019 installation and my CPU was constantly on around 30%. I noticed that Visual Studio is indexing files. On the left bottom corner you can click on an animated icon to see what is going on. After it finished this process my CPU went down to 1-2%.

enter image description here

jwillmer
  • 3,570
  • 5
  • 37
  • 73
  • You are right. It took me about 30 mins to finish indexing all files in several projects. – Sam Alekseev Apr 03 '19 at 13:44
  • 2
    I had a similar today, the animated icon bottom left is the key, lets you know if the app is up to something in the "background", in my case it was live code analysis. – Tom John May 28 '19 at 10:57
  • 7
    all it says for me is "running low priority background processes". Low priority apparently means 60+% of my 6 core/12 thread Xeon workstation. I haven't typed or touched a single thing in Visual Studio 2019 in the past 15 minutes and it's still doing *something*. What? No idea. – user99999991 Sep 03 '20 at 03:16
21

I had this problem today with VS 2019 version 16.2.3. VS had been running for several hours and was not reporting any indexing activity. High CPU usage and high memory usage.

I resolved it by deleting the files in my Windows temp folder (%TEMP%) as per Chris Hasick's answer here : https://developercommunity.visualstudio.com/content/problem/516141/very-hight-cpu-usage-by-visual-studio-2019.html

After deletion of the temp files the CPU usage dropped from 50-65% to 0.3%

Mark Willis
  • 818
  • 12
  • 19
9

For me, it was the Live Analysis thing. I turned it off following this approach: https://learn.microsoft.com/en-us/visualstudio/code-quality/disable-code-analysis?view=vs-2019. Problem solved.

FunkMonkey33
  • 1,956
  • 2
  • 16
  • 24
6

I am living with this problem since 2019 was out, the problem is Live Code Analysis never stopping:

enter image description here

And since visual studio 16.2.3 the extension responsible of live code analysis (Developer Analytic Tools) is constantly crashing:

enter image description here

Update Things got worst with visual studio v16.2.4 but improved with v16.2.5, I am still experiencing high cpu usage but less than before and Live Analysis is not constantly running as much as before 16.2.5

Max Favilli
  • 6,161
  • 3
  • 42
  • 62
  • Did you figure out how to stop the Live Analysis from crashing all the time? I just started receiving the exception when I updated to 16.8.1 yesterday. – gridtrak Nov 19 '20 at 18:19
  • @gridtrak Nope, sorry. But I find 16.8.1 pretty buggy in general. I can see there's 16.8.2 out already hope it solves them. – Max Favilli Nov 25 '20 at 13:47
5

Something that consistently works for me when I hit Visual Studio issues is to delete the .vs folder at the root of the solution.

I had the problem described here and I tried deleting the %TEMP% folder contents as suggested, but it made no difference. I was running VS 2109 on another laptop, same VS version and working on the same code base and it had no problems at all on the other laptop. As soon as I deleted the .vs folder on the new laptop, the problem went away and VS 2019 started behaving itself.

grahamesd
  • 4,773
  • 1
  • 27
  • 27
4

So maybe but the jury is still out, in my case I think it finally got better after I disabled "Show structure guide lines" in the Text Editor, General node of the visual studio 2019 options dialog. It was still happening even with the latest updates, until I turned off the aforementioned option. The class modules are large and code structures complex, so I could see it causing a lot of CPU usage, maybe.

  • Oh yes and the other thing I turned off was, "Enable mouse click to perform Go to Definition" Also of the Text Editor, General node of the visual studio 2019 options dialog. – Abcd Efghijklmnop Aug 16 '20 at 05:03
2

Not a great answer but I've had this constantly after the past few VS2019 updates. Tried deleting tmp folder etc. Nothing has fixed it; debugging takes several seconds to step through code - basically unusable for day to day development work. I deliberately have no third party tools such as Resharper to slow it down, so VS2019 should be as fast as Microsoft can make it.

Went back to VS2017 on the same code base and debugged... worked flawlessly first time without any delay... and this has Resharper installed too so should be slower.

If this is an option for you, I'd recommend it so you can get some real work done, until the VS team sort out just what they have broken.

GrahamB
  • 1,368
  • 15
  • 35
2

After edit TS file, same problem (sometimes), nodejs process start and never stopping , and don't exec others process

In VS 2019 Tools > Options > Text Editor > JavaScript/TypeScript > Language Service...

Check 'disable dedicated syntax process'

Now the "background tasks" finish and get "ready"

Wagner Pereira
  • 1,050
  • 11
  • 11
1

For me I had tasks running in the background and getting stuck at some point, causing the CPU usage to get to 40%. The solution was to see which packages were used in the analyzer and updating those for the whole solution. enter image description here

Saber
  • 5,150
  • 4
  • 31
  • 43
1

If you've got resharper installed that can use a bit. If so try updating it. I also did this ... Memory use dropped 20-30%

debug >> options >> debugging >> Symbols >> Empty Symbols Cache (click)

Options >> Web Package Management >> Web Projects >>Use 64 bit version of IIS (check)

options >> environment >> preview features (untick stuff)

Trying some of these steps, such as triggering garbage collection can help: https://github.com/MicrosoftDocs/visualstudio-docs/blob/master/docs/ide/visual-studio-performance-tips-and-tricks.md

andrew pate
  • 3,833
  • 36
  • 28
0

In my case -- I'm working on a large solution, I just unloaded the majority of projects and left what are necessary. Then the CPU useage dropped.

Zhang
  • 3,030
  • 2
  • 14
  • 31