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
634 views
in Technique[技术] by (71.8m points)

visual studio - serviceHub.Host.CLR.x86 taking a lot of memory and CPC

serviceHub.Host.CLR.x86 taking a lot of memory and CPC in my Visual Studio 2017 solution. This causes Visual Studio to crash.

Any ideas on what the underlying cause is?

question from:https://stackoverflow.com/questions/46368384/servicehub-host-clr-x86-taking-a-lot-of-memory-and-cpc

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

1 Reply

0 votes
by (71.8m points)

The serviceHub.Host.CLR.x86 is responsible for running some processes in the background for Visual Studio 2017/2019.

Among other features, there are three Visual Studio features that run under this process and, in some cases, cause high CPU/Memory usage. They are:

  1. Full solution analysis.
  2. Live Unit Testing. (only in Visual Studio Enterprise)
  3. Code Lens. (only in Visual Studio Enterprise and Professional)

Disable these features as follows:

  1. Full solution analysis: from ToolsOptionsText EditorC#Advanced (please see the remarks section if your Visual Studio 19 version is 16.5 or later)
  2. Live Unit Testing: from TestLive Unit Test
    • If the Live Unit Test is running, select Stop.
    • Go to ToolsOptionsLive Unit Testing and disable the option Start unit Testing on solution load.
  3. Code Lens: from ToolsOptionsText EditorAll LanguagesCodeLens
    • This feature has a lot of options. If you like Code Lens and want to keep using it, you can enable/disable each option to check which one is stressing your computer CPU/Memory.

That's it. I hope it helps.

Remarks:

In Visual Studio 2019 version 16.5, Microsoft removed the option to disable the full solution analysis.

However, you still have the option to narrow down the analysis scope to only one document. Select the option Current Document to restrict the analysis to the current document.


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

...