cogumel0
cogumel0

Reputation: 2661

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.

Upvotes: 3

Views: 4152

Answers (3)

Sammrat
Sammrat

Reputation: 1

I know this is old Post but, I think I need to share my solution for everyone. and this is my first post so, please improve the answer if I miss something.
I have the same issue with Visual Studio 2012, When I try to build or debug it will use CPU up to 100%.
So, I try below steps to reduce the CPU usage while debugging:

  • Please close unnecessary opened file.
  • Hide unnecessary debugging panels like: breakpoints, auto, local, output, find symbol result, etc.
  • If still use high CPU then try to hide call stack panel.
  • Remove unnecessary breakpoints.

Upvotes: 0

Newclique
Newclique

Reputation: 494

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.

Upvotes: 1

cogumel0
cogumel0

Reputation: 2661

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.

Upvotes: 1

Related Questions