Visual Studio 2013 Ultimate因为CodeLens功能导致Microsoft.Alm.Shared.Remoting.RemoteContainer.dll高CPU占用率的折中解决方案

1.为什么Microsoft.Alm.Shared.Remoting.RemoteContainer.dll的CPU占用率以及内存使用率会那么高?

在Visual Studio 2013 Ultimate版本里有个CodeLens功能.

它提供了源代码的元信息,如果结合Team Foundation Server(TFS)一起使用,它还可以动态提供一些有用的数据:单元测试结果、更改历史、工作项历史、代码引用、代码审查等。

在VS2013 Update 2以上它还有一项功能,称为“传入更改(Incoming Change)”。

详情参见CodeLens官方MSDN介绍中文版:http://msdn.microsoft.com/zh-cn/library/dn269218.aspx

说了那么多废话,其它是我想说这个功能非常棒...

所以我只有在一个解决方案里有上百个项目的时候,才会舍得去关闭这个功能,否则动不动就卡顿一下无法干活了...

要知道,公司给我配的可是一台RAM 16G, CPU i7 4770的台式机...

2.CodeLens和Microsoft.Alm.Shared.Remoting.RemoteContainer.dll有什么关系呢?

我只能猜到CodeLens调用到了Microsoft.Alm.Shared.Remoting.RemoteContainer.dll.

Microsoft.Alm.Shared.Remoting.RemoteContainer.dll应该是一个为VS提供各种数据的独立进程本地远程调用吧...例如分析,统计之类的...

而Microsoft.Alm.Shared.Remoting.RemoteContainer.dll之所以高CPU占用率和高内存使用率就是因为CodeLens.

所以呢,只要你忍痛关掉CodeLens功能,重启VS就万事大吉了..运气好的话,连重启VS都不需要,就生效了.

3.如何关闭CodeLens呢?

在VS菜单栏 >> 工具 >> 选项 >> 文本编辑器 >> 所有语言 >> CodeLens

In VS menu bar >> Tools >> Options >> Text Editor >> All Languages >> CodeLens

以下是国外友人在MS上就这个问题的提问:

https://connect.microsoft.com/VisualStudio/feedback/details/807273/microsoft-alm-shared-remoting-remotecontainer-high-cpu

https://social.msdn.microsoft.com/Forums/vstudio/en-US/61ae168e-af29-4d50-8fa4-1a743a3ca4e8/microsoftalmsharedremotingremotecontainer-high-cpu?forum=visualstudiogeneral

这上面有人说,这个卡顿问题,在Visual Studio 2015可以得到解决,不知是真是假...

反正我试过VS2015也是一样这个问题...

原文地址:https://www.cnblogs.com/VAllen/p/microsoft-alm-shared-remoting-remotecontainer-high-cpu.html