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. Paul Parker 1 Reputation point
    2022-05-17T14:41:34.943+00:00

    Using VS Community 2022(64-bit) v17.2.0 and it crashes after about the 3rd or 4th run of my code every time. I'm just taking a tutorial and code is super basic. Should I downgrade to 2019?

    0 comments No comments

  2. Ackermann, Erik 1 Reputation point
    2022-07-11T14:52:42.797+00:00

    I found the following in my search, which seems to have solved the problem for some VS 2019 users:
    https://msicc.net/how-to-work-around-ide-freezes-in-visual-studio-2019-when-switching-between-build-configurations/

    • Open Tools / Options in Visual Studio and find the Projects and Solutions node
    • Unselect ‘Allow parallel project initialization’
    • Click ‘OK’ and close the solution
    • delete the .vs folder within the local solution folder (hidden folder)
      Be aware that this will delete, among other things, your breakpoints (visual-studio-deleting-vs-folder)

    219546-allowparallelprojectinitialization.png

    My VS 2022 (admin mode) still freezes without warning and I don't find a pattern. CPU usage is under 1% and RAM usage 1,7GB.

    0 comments No comments

  3. Pirkle, Will 1 Reputation point
    2022-11-14T15:14:10.183+00:00

    I've been dealing with VS2019 constantly freezing/hanging for a year now. It's getting really old. At one point, I deleted AppData/Local/Temp and that fixed it. Another time I freed some extra HDD space and that fixed it. Now, none of that works - 100G of free space and still have this problem.

    I've spent countless hours trying to debug this issue with no results at this point. I've followed the very many suggestions here, from toggling options on and off, disabling all extensions (that is really not a solution, BTW - it is the equivalent of saying "just remove all the rear view mirrors from your car, then you will be safe"...), making sure virus scanning omits the project folders, etc.... I've got 8G RAM and 1T SSD.

    My current situation is that VS2019 now freezes for 10 seconds literally three times every minute. Yes, half of each minute I spend with this software is wasted while waiting. Sometimes I get the white-screen overlay and "Not Responding" message but usually it just freezes. The keystrokes are not all cached. As I type "through the freeze" stuff gets lost when it un-freezes.

    I'm at the end of my rope here. I was going to switch to VS2022, but judging by the comments, it is just as bad or worse.

    Does anyone have any kind of useful suggestion here? I'm on Win10 and VS2019 16.11.20 (latest version as of today).

    0 comments No comments

  4. John Dalsgaard 1 Reputation point
    2022-12-08T16:33:43.233+00:00

    Really sad to see that so many other people have this issue....

    I waited a while and didn't upgrade to VS2022 until a month or so ago. I'm on newest MacOS (13.0.1).

    When I start debugging things run fine for some time. Then it suddenly shows the rainbow coloured wheel and hangs. I can then force-quit it. But it doesn't really recover until I have restarted the computer. Even tried a very small app after a force quit - but it hang almost instantly again.

    /John

    0 comments No comments

  5. John Dalsgaard 1 Reputation point
    2022-12-08T16:33:43.89+00:00

    Really sad to see that so many other people have this issue....

    I waited a while and didn't upgrade to VS2022 until a month or so ago. I'm on newest MacOS (13.0.1).

    When I start debugging things run fine for some time. Then it suddenly shows the rainbow coloured wheel and hangs. I can then force-quit it. But it doesn't really recover until I have restarted the computer. Even tried a very small app after a force quit - but it hang almost instantly again.

    /John

    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.