Visual Studio Constantly Hangs and Freezes or Restarts Itself Randomly

Caleb Jacobs 106 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.
4,620 questions
{count} votes

30 answers

Sort by: Most helpful
  1. Tam Nguyen 21 Reputation points
    2021-12-01T22:49:19.753+00:00

    154208-vslog-copy.txt

    Sigh had to upgrade visual studio to use .net core 3.0 so I'm getting crashes again.

    Attached is the log I had running the whole day. It crashed at the end.

    0 comments No comments

  2. Tam Nguyen 21 Reputation points
    2021-12-02T18:22:07.69+00:00

    I saw some "An exception occurred while processing a UI delay" messages. I tried disabling every extension I have on VS 2019 but no luck.

    0 comments No comments

  3. Tam Nguyen 21 Reputation points
    2021-12-09T15:08:07.33+00:00

    Updating to VS2022 works for me no more crashes.


  4. Kågström, Mattias 11 Reputation points
    2021-12-14T09:29:42.657+00:00

    I have the same issue, and it got much worse after my solution went over 82 projects (now at 85).
    Every time I switch git branch it hangs and i have to restart it. It also hangs about 50% of the time i open a web.config-file.

    Windows logs "Application Hang" in the eventlogg

    Programmet devenv.exe, version 17.0.31919.166 avslutades eftersom det slutade samverka med Windows. Ytterligare information om problemet kan finnas i problemhistoriken i Säkerhet och underhåll på Kontrollpanelen.
    Process-ID: 9288
    Starttid: 01d7f0c4fda97014
    Avslutningstid: 11
    Programsökväg: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.exe
    Rapport-ID: 3e50e93e-9023-49c8-b744-557b6a84eee5
    Fullständigt namn på felaktigt paket:
    Program-ID relativt till felaktigt paket:
    Typ av låsning: Unknown


  5. Shane Farmer 1 Reputation point
    2022-03-01T20:18:38.393+00:00

    Mine starts fine as non-admin, but I need to run as Adminsitrator for other things to work. It starts to load and freezes at a blank grey windows.