Why Visual Studio 2010 uses 100% CPU core after adding a file

Category: c# ide

Question

edunique on Wed, 14 Nov 2012 11:17:31


After adding a source file to the project, devenv.exe consumes 100% of a core (sometimes fluctuating but mostly 100%).

This only happens in one of my SLN files that I'm aware of.  I've tried 3 sln files and this only occurs with one in particular.   All projects are c/c++ projects. 

Closing and re-opening the solution brings the CPU issue back down.

I've tried:

  • devenv reset settings
  • disable rich UI
  • disable extensions
  • delete .suo file
  • clean project

Process Monitor shows the CPU usage attributed to the main thread (devenve.exe).  Nearly all the call stack grabs look like DLL calls:

example 1:

ntdll.dll!RtlLeaveCriticalSection+0x26
vcpkg.dll!VSDllUnregisterServer+0x1b4dfb
ntdll.dll!RtlLeaveCriticalSection+0x26
vcpkg.dll!DllCanUnloadNow+0xa72b
vcpkg.dll!DllGetClassObject+0x1f373
vcpkg.dll+0xb146
vcpkg.dll+0xb039
msenv.dll!DllMain+0x9642
msenv.dll!DllMain+0x9895
msenv.dll!DllMain+0x97af
msenv.dll!DllMain+0x9764
msenv.dll!DllGetClassObject+0x2a41
msenv.dll!DllGetClassObject+0x2972
msenv.dll!DllGetClassObject+0x28d3
msenv.dll!DllGetClassObject+0x28a0
msenv.dll!DllGetClassObject+0x27e2

example 2:

msenv.dll!DllMain+0x9904
msenv.dll!DllMain+0x9938
vcpkg.dll!DllGetClassObject+0x2155d
vcpkg.dll+0xb17a
vcpkg.dll+0xb039
msenv.dll!DllMain+0x9642
msenv.dll!DllMain+0x9895
msenv.dll!DllMain+0x97af
msenv.dll!DllMain+0x9764
msenv.dll!DllGetClassObject+0x2a41
msenv.dll!DllGetClassObject+0x2972
msenv.dll!DllGetClassObject+0x28d3
msenv.dll!DllGetClassObject+0x28a0
msenv.dll!DllGetClassObject+0x27e2
msenv.dll!VStudioMain+0x78

any help would be appreciated.  thanks!

Replies

CoolDadTx on Wed, 14 Nov 2012 14:45:57


The callstack is indicative of a COM object reference not being cleaned up.  Adding a file is an expensive operation so the fact that VS goes to 100% is not shocking. But it shouldn't stay there more than a second or two.  But there are lots of things that can get in the way including the file system, anti-virus, etc.  Let's start with the simple stuff.  Did you try running VS in safe mode (/safemode)?  This is different than disabling extensions using Extension Manager.

Michael Taylor - 11/14/2012
http://msmvps.com/blogs/p3net