Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2015 Update 2 message: "Low memory detected. Full solution analysis disabled for this solution."

I just updated Visual Studio 2015 with Update 2.

Now, after few hours of working fine, I received: "Low memory detected. Full solution analysis disabled for this solution." that appears on the top of my editor dock panel of VS2015.

I saw that a bug had been reported at Microsoft Connect.

Notes:

  • I'm using Resharper.
  • My solution is pretty big, ~32 projects in it.

If anybody has a workaround or a hint on what to do to solve this, please let me know.

Update: I have pretty much the same feelings as Anders Forsgren (first comment). That's sounds to me a good summary of the situation.

Update 2 (2016-04-20) I recently (3 days ago) made a big clean up of my Framework.Net installed packages (from "Programs and features") where I removed about 20-30 packages. Some were in Russian. I also re-installed Visual Studio and ReSharper. All of that seems to have add some stability to my environment (less or no more freezes -> time will tell). Also, there is a new (2016-04-19) .NET Framework Repair Tool Version that came out recently. Perhaps it could help to fix some of our problems, if any related?

Update 3 After some tests and read some peoples text. It seems that it is not related to .Net framework itself or Resharper. It seems to be related to VS2015 itself, probably Roslyn. I didn't success to remove Roslyn/CodeAnalysis from VS2015, it appears to be an essential part. It sounds like we will have to wait for a Microsoft fix to have a stable environment.

Update 4 (2016-04-26) See John Atwood answer. Lots of information. I just started to test its answer. Update 3 should solve this issue (when available ???).

Update 5 (2016-04-26 + 6 hours) After 1 restart done by VS itself, one incredible slowness and also one message "Low memory...", I could confirm that disabling Full Solution analysis does not fix the problem, at least on my machine. I currently don't know any fix/workaround that works on my machine.

Update 6 (2016-06-15) Mladen Mihajlovic woke me up. I just realized that I forgot to tell about the availability of VS2015 Update 3 RC (please note that I think it is the second release: Update 3 RC2). It is available since june 7 at MSDN, RC1 = 14.0.25401.00 while RC2 = 14.0.25402.00. It sounds to be a lot more stable (I highly recommend it).

like image 479
Eric Ouellet Avatar asked Apr 04 '16 17:04

Eric Ouellet


4 Answers

After a very brief analysis it seems that issue can be related to CodeAnalysis implementation which is enabled by default and I could not find any configuration file option which can disable it.

Here are reference search results.

I was however able to successfully disable CodeAnalysis VS plugin for the time being and it seems it made a difference in how smoothly VS runs.

The only change was to rename CodeAnalysis extension plugin folder from:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\CodeAnalysis

to

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\CodeAnalysis_disabled

This obviously will degrade VisualStudio feature set and possibly cause some side effects but since I'm using ReSharper's own alanylsis features, the VS CodeAnalysis was just excessive.

Update:

It looks like Microsoft.VisualStudio.CodeAnalysis.VCPlugin.dll is also added to GAC and protected from deletion by gacutil. To forcibly remove it from GAC following steps are required:

  1. Delete the following registry key but save it first just in case:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Installer\Assemblies\Global] "Microsoft.VisualStudio.CodeAnalysis,version=\"14.0.0.0\",publicKeyToken=\"b03f5f7f11d50a3a\",processorArchitecture=\"MSIL\",fileVersion=\"14.0.23107.0\",culture=\"neutral\""=hex(7):6a,\ 00,5f,00,65,00,7e,00,5a,00,61,00,47,00,71,00,2a,00,3f,00,6a,00,61,00,31,00,\ 30,00,6e,00,66,00,70,00,4e,00,2d,00,44,00,54,00,65,00,73,00,74,00,54,00,6f,\ 00,6f,00,6c,00,73,00,5f,00,65,00,6e,00,75,00,3e,00,39,00,42,00,21,00,4e,00,\ 63,00,6a,00,24,00,58,00,70,00,45,00,42,00,75,00,6a,00,21,00,56,00,3d,00,2d,\ 00,31,00,51,00,32,00,00,00,68,00,6a,00,4f,00,46,00,70,00,48,00,2d,00,24,00,\ 4b,00,34,00,69,00,4f,00,68,00,33,00,72,00,60,00,65,00,62,00,28,00,36,00,43,\ 00,6f,00,64,00,65,00,5f,00,41,00,6e,00,61,00,6c,00,79,00,73,00,69,00,73,00,\ 5f,00,54,00,6f,00,6f,00,6c,00,73,00,5f,00,31,00,31,00,39,00,38,00,37,00,5f,\ 00,78,00,38,00,36,00,5f,00,65,00,6e,00,75,00,3e,00,39,00,42,00,21,00,4e,00,\ 63,00,6a,00,24,00,58,00,70,00,45,00,42,00,75,00,6a,00,21,00,56,00,3d,00,2d,\ 00,31,00,51,00,32,00,00,00,00,00

  1. Uninstall the assembly from GAC

"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6 Tools\x64\gacutil.exe" /u "Microsoft.VisualStudio.CodeAnalysis, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /f

It migt be also advised to move CodeAnalysis_disabled folder to another location as I cannot tell how VS MEF loader is implemented and where will it search for plugins.

like image 197
too Avatar answered Nov 08 '22 09:11

too


A workaround for this issue is to disable Full solution analysis by going to Tools -> Options -> Text Editor -> C#(or Basic) -> Advanced -> Uncheck "Enable full solution analysis".

This appears to be a bug that the Rosyln team is working on https://github.com/dotnet/roslyn/issues/10365

like image 34
John Atwood Avatar answered Nov 08 '22 10:11

John Atwood


I read some articles describing this problem as exceeding of virtual address space because some internal memory structure (List maybe) exceeds 2GB. 2GB is the default virtual address space for 32 bit processes like VS 2015. But you can adjust it to maximum of 3GB.

The solution I found is from here :

Start▸All Programs▸Accessories▸right-click on Command Prompt▸Run as administrator

Run the following command:

bcdedit /set IncreaseUserVa 3072

Restart the computer.

This is not 100% solution because you can eventually run out of virtual address space even with 3GB of RAM for a process. After adjusting this switch VS stopped complaining about memory.

like image 3
Ognyan Dimitrov Avatar answered Nov 08 '22 09:11

Ognyan Dimitrov


Few weeks now with update 3 available and nobody answering...

"Visual Studio Update 3" fix that issue and solve many others. A MUST !!!

I recommend to read this before installing Update 3: Visual Studio 2015 Update 3 and .NET Core 1.0 Available Now from John Montgomery.

Direct Download link: Visual Studio Update 3

like image 3
Eric Ouellet Avatar answered Nov 08 '22 10:11

Eric Ouellet