Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
530 views
in Technique[技术] by (71.8m points)

.net - Visual Studio CPU High Usage

It's a week that I have any Visual Studio (2010 professional, 2012 professional and 2015 community edition) that, after few minutes I started a project even empty, without touching anything, start a thread that consumes entirely one core, 100% usage. From task manager I've seen that devenv.exe is consuming 25% of CPU, I have 4 cores so 100/4=25.

By using Process Explorer I've seen that is clr.dll (clr.dll!GetCLRFunction+10793) that is running continuosly.

here is the stack trace of the thread:

ntoskrnl.exe!KeWaitForMultipleObjects+0xc0a 
ntoskrnl.exe!KeAcquireSpinLockAtDpcLevel+0x712
ntoskrnl.exe!KeWaitForSingleObject+0x19f
ntoskrnl.exe!PoStartNextPowerIrp+0xba0
ntoskrnl.exe!PoStartNextPowerIrp+0x183d
ntoskrnl.exe!IoFreeErrorLogEntry+0x297
System.ni.dll+0x19ab70
System.ni.dll+0x1de979
System.ni.dll+0x19ab70
System.ni.dll+0x199d42
System.ni.dll+0x1ded86
System.ni.dll+0x1de5fa
System.ni.dll+0x1de397
System.ni.dll+0x1da636
System.ni.dll+0x1c755e
System.ni.dll+0x19ebfb
System.ni.dll+0x19eccf
clr.dll+0x1396
clr.dll+0x291f
clr.dll!PreBindAssemblyEx+0x1822c
clr.dll!PreBindAssemblyEx+0x183af
mscorlib.ni.dll+0x2f1213
mscorlib.ni.dll+0x2f103e
mscorlib.ni.dll+0x2ffb72
mscorlib.ni.dll+0x30a366
mscorlib.ni.dll+0x2ffd30
mscorlib.ni.dll+0x3aebef
mscorlib.ni.dll+0x3aeaba
clr.dll+0x291f
clr.dll+0x9aff
clr.dll!PreBindAssembly+0xb165
clr.dll!PreBindAssembly+0x9653
clr.dll!PreBindAssembly+0x96bd
clr.dll!PreBindAssembly+0x978a
clr.dll!PreBindAssembly+0x9805
clr.dll!PreBindAssembly+0xb0f9
clr.dll!PreBindAssembly+0xa166
clr.dll!GetCLRFunction+0x107dc
ntdll.dll!RtlInitializeExceptionChain+0x63
ntdll.dll!RtlInitializeExceptionChain+0x36

Does anyone understand something from the above lines??

On Internet I've found several suggestion to disable one or another plugin/extension of visual studio, by none of them solved the problem, and moreover I have the problem on all the VS version (with different extension and happened at the same time)

I think it's something related to the .net framework 4.5 ~4.6 that I have updated recently. How can I understand where is the problem and how to solve it?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

To see why Visual Studio causes such a high cpu usage you need to install the Windows Performance Toolkit, which is part of the Windows 10 SDK (if you use Windows 7, use the SDK Build 15086, which is the last version that works on Windows 7, for Windows 8,8.1 or Windows 10 use the WPT from latest Windows 10 SDK).

enter image description here (all other entries can be unselected)

Run WPRUI.exe, select First Level, CPU Usage and click on start. Capture 1 minute of the CPU usage, now click on Save to save the data into a ETL file.

Now make a double click on the generated ETL file to open the ETL in Windows Performance Analyzer (WPA.exe), drag and drop the CPU Usage (Sampled) to analyze pane:

enter image description here

Now load debug symbols in WPA and expand the stack of the devenv.exe

enter image description here

In my case the Telerik Extension causes CPU usage inside Visual Studio.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...