.net - Visual Studio CPU 高使用率

标签 .net visual-studio visual-studio-2010 visual-studio-2012

这是我拥有任何 Visual Studio(2010 专业版、2012 专业版和 2015 社区版)的一周,几分钟后我开始了一个项目,甚至是空的,没有接触任何东西,启动一个线程,它完全消耗一个核心,100% 使用率。
从任务管理器中我看到了 devenv.exe 消耗 25% 的 CPU,我有 4 个内核,所以 100/4=25。

通过使用 Process Explorer,我看到是 clr.dll ( clr.dll!GetCLRFunction+10793 ) 持续运行。

这是线程的堆栈跟踪:

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

有没有人从上面的几行中理解一些东西?

在互联网上,我发现了一些禁用 Visual Studio 的一个或另一个插件/扩展的建议,他们都没有解决问题,而且我在所有 VS 版本上都有问题(具有不同的扩展并且同时发生)

我认为这与我最近更新的 .net framework 4.5 ~4.6 相关。
我如何了解问题出在哪里以及如何解决?

最佳答案

要了解为什么 Visual Studio 会导致如此高的 CPU 使用率,您需要安装 Windows Performance Toolkit,它是 Windows 10 SDK 的一部分。 (如果您使用 Windows 7, use the SDK Build 15086 ,这是适用于 Windows 7 的最后一个版本,对于 Windows 8、8.1 或 Windows 10,请使用最新的 Windows 10 SDK 中的 WPT)。

enter image description here
(可以取消选择所有其他条目)

运行 WPRUI.exe ,选择 一级 , CPU 使用率 然后点击 开始 .捕获 1 分钟的 CPU 使用率,现在单击 保存 将数据保存到 ETL 文件中。

现在双击生成的 ETL 文件以在 Windows Performance Analyzer (WPA.exe) 中打开 ETL,拖放 CPU Usage (Sampled) to analysis Pane :

enter image description here

现在 load debug symbols in WPA并展开 devenv.exe 的堆栈

enter image description here

在我的情况下,Telerik 扩展会导致 Visual Studio 中的 CPU 使用率。

关于.net - Visual Studio CPU 高使用率,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36484534/

相关文章:

visual-studio-2010 - Visual Studio - 缺少客户端对象和事件下拉列表?

c++ - 为什么每个c++项目只能在visual studio中构建一个可执行文件?

c# - 使用泛型作为异步方法的返回类型

c# - 如何将 Serilog 依赖注入(inject)到 .NET 控制台应用程序中我的其余类中

visual-studio - 为什么每次打开 .xaml 文件时我的 Visual Studio 2008 都会关闭?

c++ - 是否有关于更换 MS CRT 的最新引用资料?

c++ - 未解析的外部符号 _IID_IDXGIFactory

c# - 根据 GridView 中绑定(bind)的数据更改 ASP 按钮的属性?

c# - .NET - 加拿大日期时间格式错误

git - VS Code Git 干净恢复