Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2012 high CPU usage and unable to debug

I'm using Visual Studio 2012 Update 3. When I open a project, VS automatically creates a process called <myproject>.vshost.exe, even before starting to debug.

When I start debugging and later close the debug application, most of the times the <myproject>.vshost.exe process closes as well. When this happens, devenv.exe starts taking up 3x more memory than normal and CPU goes up to 25% (on a i7 Quadcore with 8GB ram) for around 1 minute. At the end of 1 minute, a new <myproject>.vshost.exe opens up (even though I'm not debugging), CPU falls back down to 0 and memory drops back down as well.

Trying to start debugging whilst the CPU is at 25% and <myproject>.vshost.exe is not running in the background will results in the solution building but the debug does not start.

If I wait until the CPU falls back down and <myproject>.vshost.exe process is running again then I can start debugging normally.

This happens to me 80% of the times after closing the application I am debugging. The remaining 20% of the times when I stop debugging <myproject>.vshost.exe continues running in the background and I am able to start debugging again immediately after with no delay.

This also happens regardless of code changes in between debugs.

This is a new install of VS2012 U3, I've tried resetting all settings and disabled ReSharper but still no joy.

I don't want to disable vshost debugging because of the features I would lose.

Has anyone else encountered this problem before? Is this a known issue? Are there any solutions/workarounds?

EDIT

I changed the platform from Any CPU to x86 and it appears to work properly, but I still can't understand why I shouldn't be able to debug it as Any CPU. Even though this might be the workaround I'd still be interested in knowing whether this is a known issue and if there are other (better) solutions.

By 'working properly', I mean that when I stop debugging the vshost doesn't close, in fact it never closes, but the CPU of devenv stays at 0% and it allows me to start and stop debugging as many times as I want one right after the other.

EDIT2

Actually it appears that changing the platform to x86 only worked properly for a while, after about 20 rebuilds it is now doing the same as leaving it as Any CPU.

On another note, closing and opening VS makes no difference.

like image 964
cogumel0 Avatar asked Apr 18 '26 12:04

cogumel0


2 Answers

I've ended up formatting the computer again and re-installing everything from scratch. For not it appears to be working fine, let's see how long this lasts for.

like image 148
cogumel0 Avatar answered Apr 21 '26 12:04

cogumel0


I know this is several months old but I'm trying to post this answer in a few places since this is what was causing my ills: I had the Data Sources toolbox open in Visual Studio 2012. Once I closed that, it seemed to eliminate the lengthy delays when switching windows. You may also want to close Server Manager if you don't need it open.

like image 35
Newclique Avatar answered Apr 21 '26 13:04

Newclique



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!