Visual studio 2015 high cpu consumption when idle - visual-studio

I have visual studio 2015 enterprise edition, update 1.
When idle, the visual studio process is using around 10-15% cpu constantly.
I tried the solutions provided here with no success.
The solution includes 11 c# projects.
The issue seems to appear only after the first compilation after the solution.

In my case a few *.mdb files had been added to the solution which triggered a constant cpu usage of 30-35%.
So generally the content of a solution triggers background tasks which can lead to high cpu usage. If that usage occurs suddenly, it's worth to get maybe an older source version to check, if the problem is related to added files.
In my scenario the visual studio process remained active using cpu even after closing visual studio. Using process explorer I identified two threads using the cpu indicating following start addresses:
clr.dll!CreateApplicationContext
devenv.exe!IsAssertEtwEnabled

After a lot of attempts and tests to fix this issue, I finally discovered the source of it.
I had a Code Map dgml file in the solution.
Removing the file fixed the issue, and now the devenv process cpu consumption returned to normal.
UPDATE:
After some time working, it seems that just removing the Code Map dgml didn't entirely solve the problem. The solution at last was to remove the reference to the "Modeling Project" containing it(along with other documents such as Sequence Diagrams...).

Related

Visual Studio slowness, possible reason?

Im struggling with extremely slow Visual Studio. I use it to build C++ projects mostly.
Everything could be super slow. Menu's loading, intelIsense tips, builds. I've just tested building simple solution in 1 file, and build took around 5 minutes. But! I found this article about Windows Performance Analyzer which I used to trace this solution build. Despite overall time taking around 5 minutes, WPA report build took only around 0.686 seconds, attaching screenshot:
apparently I press "rebuild" in VS and build itself started ~300 seconds later(timeline).
Currently I use VS2019. Same problem I observed on VS2017. I did removed all VS components and installed VS2019 and problem is not gone. All other programs run fine. No excessive CPU load(intell 6700k), no noticeable harddrive usage(windows and VS components are on m2 ssd, lightning fast), 32 gb ram and enough free space on system disk.
Only VS extension I installed myself is QT extension for VS2019. Which actions can I take next to find the problem?
Things to try:
devenv /safemode from a command line starts the IDE in safe-mode with all plugins disabled.
Visual Studio Installer and repair install
Disable graphics acceleration in Visual Studio (Tools|Options|General ... there are a few "rich client visual experience" related things)
Check paths on your computer. If other apps run fine but one does not, it could be that this app tries to access a network drive or website which is not available.
Run "procmon" and "procexp" (Process Monitor/Process Explorer from Sysinternals) and take a look at what's going on.
Try VS 2022.

Microsoft.VsHub.Server.HttpHostx64.exe consuming loads of resources and crashing Visual Studio 2015

I am experiencing this behavior for some days now.
Microsoft.VsHub.Server.HttpHostx64.exe goes bananas consuming resources and Visual Studio stops responding and crashes when a breakpoint is hit.
I heard this process is related to performance analysis but even if I disable it the problem keeps happening (even though it shouldn't crash VS neither debilitate the user interaction).
Anyone had the same problem and found a solution for this?
VS2015 has a bug which allows the task named Microsoft.VsHub.Server.HttpHost64.exe to consume all the free ram so your computer pages to disk and slows things down. When I killed that task it had no adverse effects on my program, and reduced disk activity from high levels to low levels. The task may restart itself, but instead of consuming 10+ GB of memory, it then consumes about 40MB. The bug only appears when running the GUI / IDE, not your compiled program.
It may be possible to programatically kill that task, haven't tried it.
Also, here is another possible workaround which can be seen at https://connect.microsoft.com/VisualStudio/feedback/details/1610160/microsoft-vshub-server-httphostx64-exe
** The following may require you have administrator privileges on the box ***:
1. close all instances of Visual Studio 2015
2. Locate directory C:\Program Files (x86)\Common Files\Microsoft Shared\VsHub\
3. Rename VsHub to VsHub-Suppressed
Once the above has been performed, Visual Studio 2015 will start noticeably quicker.

Visual Studio Devenv.exe high cpu Usage

I am using VS 2013 ultimate, working on a project with Team Foundation Server. The problem is, every ten seconds, it hangs for up to 5 seconds, I am not compiling or anything, just writing code. Devenv.exe process jumps to more than 25% CPU and 670k of RAM. I have looked at the output from the JavaScript Language Service, and it constantly checks and says Referenced file 'D:\tfs\xxx.aspx' not found. Text search of the filename xxx.aspx in entire solution turns up nothing and I have the latest version. I think this is the reason of the spikes, does anyone know how I can turn off this feature in VS 2013?
EDIT: I have looked at other solutions, Browser Link is closed, I have the latest update
EDIT: I have found the solution, but I dont think it will really help anyone else. One of the guys referenced a hard drive path on top of a javascript page, and since the project is tens of thousands lines, cpu spiked as Visual Studio was searching it. Deleting the references helped in my case.
To narrow down this issue:
Try to disconnect from TFS server. (In VS→ Team → Disconnect from
Team Foundation Server) Check whether this abnormal phenomena still exist.
Use devenv/resetuserdata command to clear user settings of VS,
details refer to this blog: VSTS Tip: devenv /resetuserdata
If you are using proxy in your machine, try to disable the proxy
settings.
If there is anti-virus in the machine, also try to disable it.

Visual Studio 2013/2015 Idle CPU usage

I'm currently evaluating Visual Studio 2015 RC. I've noticed when running the IDE, The Visual Studio 2015 process is constantly at around 25% CPU usage. Even without a project loaded and without the welcome page it is gobbling up 25% CPU usage at a constant rate. No other applications running other than background services. All other running processes use around an additional 2 to 4 percent CPU overall.
This behavior has also been noticed in Visual Studio 2013.
Is anyone else seeing this behavior? Is this normal? Any suggestions?
Had this same problem. Processor constantly at 45-50% even when the IDE is completely idle.
Turns out the problem is the Microsoft Git Source Code provider.
I turned that off and processor dropped to 0 and the IDE became much more usable.
In my case disabling Telerik ASP.NET MVC Extension solved high CPU issue.
High CPU load started on solution load and didn't drop (40% with one, 80% with two solutions) until VS was closed or even sometimes after (had to kill the process).
Tools->Extensions and Updates->Installed, find the extension and click 'Disable'.
In my case all reference counts tried to update every time when I edit code.
I have just turned them off. You can do it this way.
It’s not to be expected that Visual Studio should chew up continuous CPU time.
I am running Visual Studio 2015 Community RTM right now with a medium sized project open, and am not seeing any ongoing CPU usage (according to Process Hacker 2, which shows usage as small as 0.01 percent). It’s just blank, which means not even 0.01% CPU usage is registering.
Keep in mind that IntelliSense scans your project files in the background to build the database for popping up its suggestions, etc.
Choosing Project > Rescan Solution from the menus will result in that process being done over, which will cause the CPU to be used for a time. But it should ultimately go quiet.
Seemingly forever, there have been times when deleting the Intellisense Database files and doing a full rescan solves “odd behavior” type problems. I don’t know if it’s the “prescribed” method, but if I suspect an IntelliSense problem I just delete the .sdf file in the project folder if I want to make sure Visual Studio starts with a clean slate. This isn’t necessary very often.
I also had this problem, constant 20-40% CPU when idling (Visual Studio 2015 update 1). I noticed that other local repositories of the same code did not have this problem.
I deleted the problematic local repository and took a new checkout, this solved the issue for me. Why this worked, I unfortunately cannot explain...
I run resharper, turned that off and turned off the Microsoft Git provider and still had high CPU issues, devenv.exe would also run after close... until recently.
It appears VS 2015 Update 2 has resolved these issues!
https://www.visualstudio.com/en-us/news/vs2015-update2-vs.aspx
In my case; "Visual Studio 2015 Update 1" gone crazy editing JS files regarless of the length of the source. It used high CPU and the editor is even freezed. I fixed the issue by disabling the 3rd party add-ons by one-by-to detect the buggy one causing VS 2015 malfunctioning.
Hope it works.
In my case, the culprit was Node.js tools for Visual Studio. I had v1.1.2 installed and the cpu was constantly around 25-40%.
A switch to Node.js Tools v1.2 RC resolved the problem completely after an initial high load that went away in a couple of minutes.
In my case it was either the Roaming Extention Manager or most probably the azure worker role project in my solution. If you have one of these try unloading it and restart visual studio. I can reproduce it but I don't know why it happens.
I've noticed also that when running and stopping a debug episode on the local server, if the page is still open in the browser, VS will continue to run at high CPU. Closing the browser page stops this.
I want to share my experience,
In my case I had to diable all extensions and updates and code analysis c#.
1-For extensions and updates :
Tools => Extensions and updates
2-For the code analysis
Solution explorer => right click on the project => Properties =>Click on the tab "Code analysis" => click on the "Open" bouton => Uncheck the checkbox "Microsoft.CodeAnalysis.CSharp" => save and exit.
Cpu usage descended to 1 %.
In my case, The .suo file in Visual Studio was the culprit. Deleting it fixed my issue.
Refer below link for more details.
https://shemeerns.com/2014/04/04/the-solution-user-options-suo-file-in-visual-studio/

Visual Studio 2010 - How to optimize

I am using the 2010 version of Visual Studio, but am having many problems with delays - my computer has a good configuration of RAM, and processor - especially when saving files.
Currently I am carrying a medium-sized project, only one open file (ASP.NET page) using a single suite of components from third party, the Telerik. And yet, in time to save, or modify the tab, the entire IDE is slow. I know there may be several factors for this problem, but I'm not carrying the computer (the problem apparently is the memory management on behalf of the IDE).
Does anyone know any way to improve it? Change settings, Windows services. Oh yes, I'm using a plugin to modify the color of the IDE and another to find (Ctrl-click) the object reference.
Memory Initialization:
Memory: 280000K
Virtual Memory: 350000K
Have you tried disabling all the plugins and make sure that it is VS that actually causes the slowdown?
I have Resharper installed and VS can be slow sometimes. I turned it off (suspend on v5), and VS is back to blazing speed. Of course, inversely coding productivity is impaired by not having Resharper.
There are many causes and circumstances that can lead to what you're describing. So I'd better recommend you to check the links bellow...
VS.Net 2010 IDE Very Slow
VS 2010 very slow
VS 2010 slow for edit of first file in project with many web references
VS2010 C#: Delay when opening a file inside IDE

Resources