I'm working with Visual Studio 2022 and blazor .net 6. After 1 hour of continuous work, visual studio's memory consumption is very high and it crashed on my PC (windows server 2019).
-
1this not have problem with normal asp.net core api project – sajjadarash Jan 12 '22 at 14:51
-
https://stackoverflow.com/questions/70584957/how-do-i-fix-visual-studio-2022-out-of-memory-issue – Steve Greene Jan 12 '22 at 14:58
-
2Your app "Psyco.Time2Work.UserInterface" is using 3.3 GB of memory. You should fix your memory leak. (When you run an app from Visual Studio, they spawn as a child process of VS, which is probably throwing you off) – Kirk Woll Jan 12 '22 at 15:27
-
Please provide enough code so others can better understand or reproduce the problem. – Community Jan 20 '22 at 20:41
-
20 Gb RAM used, same Total ~ 83% so it's allocated almost all you have for no reason (working slowly than ~month ago) – Kamerton Aug 31 '22 at 11:50
-
3After spending few days and trying all the suggestions in this page and others online, there have been no tangible results at least for me. Given I have even added more RAM to my pc, and the more RAM I added, the more VS 2022 was consuming, in the end I found an awesome solution which is working just great: rolled back to Visual Studio 2019 – znn Mar 16 '23 at 17:49
5 Answers
A coworker of mine found the memory leak.
If you disable these two checkboxes your problem is fixed.
Tools -> options -> Text editor -> Advanced
Disable the following:
Enable pull diagnostics (experimental, requires restart)
Enable razor pull diagnostics (experimental, requires restart)

- 5,187
- 1
- 21
- 32
-
I was hoping this would work, it didn't. VS taking 20GB of memory to debug or publish my Blazor project. – Enkode Apr 28 '22 at 23:29
-
8For me disabling "run code analysis in separate process" did the trick. I managed to go down from 10GB to 2.5 GB. Disabling "pull" options mentioned above shaves off additional 0.5 GB, resulting in approx 2GB usage. – koxy Jun 08 '22 at 07:52
-
2I am able to cut down 9GB (from 10GB usage to 1GB) by the following methods. 1. Done Hoàng Gia Huy's suggestion (Symbols), 2. Disabled "run code analysis in separate process" 3. Disabled "pull" options – Vishal Kottarathil Jun 09 '22 at 05:13
-
This solved it for me as well. The difference was significant and unmistakable. (I did not do the "Symbols" change) – Niels Brinch Aug 23 '22 at 08:28
-
This solved the issue for me as well but during the build time some recoverable errors mentioning "The build stopped unexpectedly because of an internal failure. Microsoft.Build.Exceptions.BuildAbortedException: Build was canceled." The build ended successfully, but it was slower (I guess some retrials occurred). – Alexei - check Codidact Jun 09 '23 at 07:39
-
From 6GB to 1 GB with "Enable pull diagnostics" and "Run Code Analysis" disable action, thank you! – Cem Jul 13 '23 at 10:31
-
"Enable razor pull diagnostics (experimental, requires restart)" Not found in Microsoft Visual Studio Enterprise 2022 (64-bit) - Current Version 17.5.4 – Ahmad Jul 16 '23 at 10:21
-
1
I fixed 98% Ram --> 50% Ram when Set the options to Only specified modules.
Solution 1:
To specify symbol loading, open Visual Studio choose Tools > Options > Debugging > Symbols > Load only specified modules.
Solution 2:
Open Task Manager (Ctrl + Shift + ESC) -> ServiceHub.Roslyn... -> Right Mouse -> End Task.

- 180
- 1
- 5
Visual Studio notifies you in a yellow bar when automatic document restore is causing a solution to load significantly slower. You can disable automatic file reopening by following these steps:
Select Tools > Options to open the Options dialog box.
On the Projects and Solution > General page, deselect Reopen documents on solution load.
If you disable automatic file restore, a quick way to navigate to files you want to open is by using one of the Go To commands:
For the general Go To functionality, select Edit > Go To > Go To All, or press Ctrl+T.
Jump to the last edit location in a solution using Edit > Go To > Go To Last Edit Location, or by pressing Ctrl+Shift+Backspace.
Use Go To Recent File to see a list of recently visited files in a solution. Select Edit > Go To > Go To Recent File, or press Ctrl+1, Ctrl+R.
This issue fixed in link below

- 57
- 2
- 7
These Microsoft own instructions also helped to free memory and make VS to load and run faster, but there was also some outdated information. It's weird how Microsoft can't keep its own instructions up-to-date. I use Microsoft Visual Studio Community 2022 (64-bit) - Current Version 17.6.1, and there was one part in these tips that didn't exist in the current version.
I did also use this: Tools > Options > Debugging > Symbols > Load only specified modules + these Microsoft tips above.

- 19
- 2
Microsoft said this issue fixed in new preview version link below Visual studio 17.1.2 preview But this problem still happen and not solved

- 5,767
- 5
- 54
- 69

- 417
- 1
- 5
- 8
-
10This has not been fixed. I can watch memory usage steadily increase using the Task Manager. – Doug Kimzey Mar 10 '22 at 14:36
-
3
-
On 17.3.0 here and definitely not fixed. A solution using around 400MB in VS 2019 is using 900MB in 2022 (2022 with no solution is eating around 600MB). This is with code analysis disabled and only specified modules for symbol debugging. Disabling 'pull' diagnostics as per Mo D Genesis's comment + unticking 'run code analysis in separate process' as per koxy's comment above did reduce the usage from 1.2GB – Symo Aug 15 '22 at 08:40
-
NOT fixed: Microsoft Visual Studio Professional 2022 (64-bit) - LTSC 17.4 Version 17.4.4: VS2017 use about 500 MB RAM, VS2023 about 1.5 GB (vb.net .forms project .net RunTime 4.8). Get worse with the project migrated to .NET 7.0 Project: use about 2-2.5 GB HS. – FredyWenger Feb 13 '23 at 14:33
-
Even 2023 17.5.5 has this problem. I have 16 GB ram and VS can consume even 10 GB and must close and reopent it to keep working. – Juan Pablo Gomez May 07 '23 at 15:35
-