1

I am editing a vb.net project and if I have some tabs open, the cpu fan spins up. I have to close all of them to have a normal operation again.

Its not like the code in those is particularily complicated, the cpu consumption is still at top. I am right now keeping one vb form open, its having 1622 lines. I doubt the number of lines has anything to do with it.

  • If I close the tab, the fan stops in 5 seconds
  • If I don't close the tab, the fan will continue to spin seemingly forever.

What can I do?

  • I have turned off all forms of analysis
  • I do not run any extensions
  • I have a newly installed operating system
  • I do not touch the keyboard
  • I do not touch the mouse
  • I do not run or debug the project

The version is vs2022, 17.6.0 preview 2.0

Anders Lindén
  • 6,839
  • 11
  • 56
  • 109
  • That is easy to do, just create a base form class or control whose Paint event handler causes a repaint to trigger. Everything it still functional, repaints only occur when nothing else needs to be done, but the repeated firing of the Paint event causes the main UI thread of VS to burn 100% core. Diagnose by starting VS again and attaching the debugger to the first instance. Debug > Break All has good odds to break in the troubled code, repeat several times to be sure. – Hans Passant Mar 30 '23 at 17:08
  • Why is the CPU fan running an issue? CPU fans are supposed to run in order to keep the CPU below a certain temperature. I imagine that you realize that your program (or Visual Studio) isn't the only thing using the CPU. How is this programming related? – Tu deschizi eu inchid Mar 30 '23 at 17:43
  • @user09938 I think the issue is that it's a proxy for the CPU working harder (and thus burning more power) than it ought to. Question implies that this condition is unique to running Visual Studio and doesn't happen otherwise with the machine at idle. – Craig Mar 30 '23 at 20:30
  • I do not debug or run a project, updating the question @HansPassant – Anders Lindén Mar 30 '23 at 20:44
  • To me, there should always be a good reason that the CPU fan is spinning. If I did not care about what was consuming all resources of my working tool, I would have thinked in other ways. Visual studio is the cause and in particular, according to this question when I have a vb.net file open in an editor. I need advice about how to configure my programming setup, if possible so the question is programming related. @user09938 – Anders Lindén Mar 30 '23 at 20:47
  • The CPU fan is running high when the computer has a lot to do, but since I have pinpointed most of those operations and turned off services etc, all that remains is chrome browsers (which obviously do heavy things) and having a vb.net editor open with a ridiculously small need for CPU resources. @Craig – Anders Lindén Mar 30 '23 at 20:50
  • @Craig: I disagree. The reference to the CPU fan wasn't a _passing comment_ (ie: a single sentence), but the focus of the fan is the focus of the entire post. One can't infer the intentions of the OP aside from the OP being bothered/concerned that the computer fan is running. Unfortunately, this post should be closed as _Needing details or clarity_. The only reason it hasn't been is because of the amount of points the OP has. If this post was written by a new poster it would have been closed by now. – Tu deschizi eu inchid Mar 30 '23 at 20:51
  • I do not know what kind of details you miss honestly. If every stack overflow question was this detailed, we would have achieved a lot in terms of making stack overflow more useful. @user09938 – Anders Lindén Mar 30 '23 at 20:53
  • @AndersLindén: Unfortunately, there are too many unknowns to give a definitive answer. Likewise, the number of factors that come into play are too numerous to mention in a comment. Lately it seems like Visual Studio was written (or updated) by new developers. This question may be more appropriate on _SuperUser_. – Tu deschizi eu inchid Mar 30 '23 at 20:59
  • I think programming tools are programming related. I do not need to be an administrator to run into theese problems by the way. – Anders Lindén Mar 30 '23 at 21:02
  • If you're using a _Preview_ build of Visual Studio, you should use the URLs provided wherever you downloaded it from to provide feedback. Not sure what you expected from a _Preview_ build. – Tu deschizi eu inchid Mar 30 '23 at 21:06
  • Nothing to do with running or debugging, this happens when the designer of a form is active. I gave diagnostic hints, you don't have to use them. – Hans Passant Mar 30 '23 at 21:06
  • I am sorry, I thought about paint events as things that occur to programs that are running, so I thought you missed something by suggesting that. I should try what you are writing. – Anders Lindén Mar 30 '23 at 21:08
  • I needed to run this preview build to not have all handles-directive occasionally removed from a form. It is good on that, but ok, what you are saying is that I should expect this from preview builds? I have been running this for two weeks without a released stable build available. @user09938 – Anders Lindén Mar 30 '23 at 21:12

1 Answers1

3

Yes, this has been a serious issue. It occurs also with C#.

You don't mention what version of VS you are using here. I had to roll back the version I was using. I am now am using 17.4.4, current "latest" is version 17.5.3

You could try this setting - it's for C#, but seems to help:

VS 2022: High RAM and CPU issue with Roslyn Code Analysis

This will be about my third attempt to "upgrade", but each time I had to roll back to my current version 17.4.4. The versions after that will destroy your computer with high CPU and high memory. I don't know what they changed, but this a mess until such time this issue is fixed.

Try running a pre 17.5 version, with the analyzers turned off, then CPU usage tends to not be a issue. However, I do find after having opened some C# projects (web forms), the CPU usage goes up again. A close of VS does seem to help, and it takes some time (maybe 1 hour) for the issue to occur again.

halfer
  • 19,824
  • 17
  • 99
  • 186
Albert D. Kallal
  • 42,205
  • 3
  • 34
  • 51