Visual Studio Constantly Hangs and Freezes or Restarts Itself Randomly

Caleb Jacobs 116 Reputation points
2021-08-21T13:53:55.093+00:00

I am using Visual Studio 2019. I have 64 gb of ram, use 1tb NVMe drives, 12 core 4.10 GHz processor, Windows 10 OS. And even with this decent machine, Visual Studio hangs and freezes very often. I am a programmer by trade, I code at least 8 hours a day and I'd say Visual Studio locks up, stops responding around 5 times per day and randomly crashes and restarts itself around 3 times per day. The crash/restarts don't come with a hang or any warning at all. The program just completely and instantly closes itself with no warning at all. When the program freezes, in the device manager, Visual Studio will often be consuming >50% of my CPU and >33% of my RAM - which seems like a lot given my machine. I generally give the hangs about a minute to try and resolve themselves. Maybe 10% they actually resolve themselves and I can continue on. 50% of the the time, it hangs for over a minute and I have to end task in task manager. The rest of the time, it crashes after hanging for a bit. I have notices that in the rare chance that the program recovers by itself, it often feels less stable afterwards - slow to respond, much slower to think about things, delayed typing (press keys and they don't show up on screen for a few seconds, then appear all at once). Sometimes it gets like this without any hangs first. When it gets like this, I end up killing visual studio and restarting it to try and get back to a usable state.

I code unreal engine projects mostly and use the engine source so my projects are always rather large. The only plugins I use are Visual Assist and CodeMaid but the crashes/hangs happen without these plugins as well.

What can I do to make my Visual Studio more stable? These crashes and hangs are very disruptive.

P.S. the tag system on this forum is really frustrating and unintuitive to use. The user should be able to see all available tags or add their own. Or there needs to be a smarter lookup. I tried tagging this issue with 'crash' 'hang' 'unresponsive' 'visual studio' 'vs2019' and a few others and none of them were valid tags and it gives you no clue what tag it does have that might be similar. I ended up having to search for similar issues on this site to this one and see what tags they used. I had to use 'vs-general'. For your system to guess what tag you're trying to add, you have to give at least 3 characters (why? you can do better. It should guess from the very first character.) Do you see the problem? Provide 3 characters? 'vs-general'? How on earth is someone supposed to guess that the magic 3 characters they need to type in is 'vs-'? Please do better.

Visual Studio
Visual Studio
A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.
5,103 questions
{count} votes

31 answers

Sort by: Most helpful
  1. Matthew Whited 1 Reputation point
    2023-01-02T23:55:17.557+00:00

    This is highly annoy. I'd love to see microsoft blame the hardware as this only happens on my Surface book.

    0 comments No comments

  2. Pirkle, Will 1 Reputation point
    2023-01-23T21:17:42.9833333+00:00

    I have more information for those with the VS2019 Freezes/Hangs constantly.

    Out of desperation, I decided to move to VS2022 to see if that would fix the problem.

    The answer is NO.

    The problem still exists, and now is even worse.

    How could it be worse you might ask?

    In VS2019, if I wasn't looking at the screen while typing and it was in its self-induced coma, when VS2019 did wake up, all of the keystrokes cached would pop out at the same time.

    In VS2022, if I type while it is frozen (which is all the time), when it wakes up from its coma - it simply crashes. Boom - that's all she wrote. Any edits are gone. Restart VS2022.....

    When debugging realtime audio with this horrible setup, if it freezes, it may stay that way forever (I've let it go all night), or it may come out of coma within a few minutes - you never know.

    I can't imagine how horrible VS2024 is going to be.

    0 comments No comments

  3. Dan Neault 0 Reputation points
    2023-03-23T13:12:46.29+00:00

    Happens every time I change Internet connections

    VS19 and 22

    0 comments No comments

  4. Ghislain, Ludwig 0 Reputation points
    2023-03-31T08:20:13.12+00:00

    For me visual studio 2019 has less freezes when running the WPF application after installing the version 16.11.25

    0 comments No comments

  5. Gene Kochanowsky 0 Reputation points
    2023-06-02T13:59:00.54+00:00

    VS 2022 is freezing for me specifically when I try to close a file tab. I have "Show Tabs in Multiple Rows' selected.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.