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

MemoryVisual Studio-2015

Memory Problem Overview


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).

Memory Solutions


Solution 1 - Memory

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.

Solution 2 - Memory

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

Solution 3 - Memory

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 :

StartAll 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.

Solution 4 - Memory

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

Solution 5 - Memory

My answer is to Close and Open Visual Studio.

I have "Enable full solution analysis" unchecked and I am still getting the Visual Studio message "Low memory detected. Full solution analysis disabled for this solution." Visual Studio 2015 version is 14 Update 2. I find that I have to close VS.

VS becomes unable to open TFS tasks and I cannot check in code unless I close and reopen VS. Thankfully I have a new solid state hard drive so the VS close/open does not make me wait terribly long like it did before. But still a disappointing hassle.

Solution 6 - Memory

I had been putting up with this problem for a while. I would see the memory usage climb steadily when working with TypeScript files, leading to an eventual crash. If this could be your situation, check if you have rxjs anywhere in your project. If the version is 5.0.0-beta.2, then upgrade to 5.0.0-beta.3 (or higher) to fix it.

More details: https://github.com/Microsoft/TypeScript/issues/7344#issuecomment-198392320

Solution 7 - Memory

I wish I had a magic bullet. But here is what has helped me, but now always solves the problem. VS2015 Update 2. Resharper 2016.1.1. All projects are vNEXT.

  1. In Resharper --> Options --> Code Inspection --> Settings. Add as many the wwwroot folder. I also added each folder unter wwwroot as it didn't seem to cascade. In File Masks, add any framework *.js or *.css (ie *.min.js, *jquery.js, *angular.js, *.min.css). This step helped cut down on the "Loading source files" that resharper does when I build js/css with Gulp, Grunt for publish.

  2. This is not ideal, but when I am writing code and don't plan on testing, I will Unload all of the projects that I am not using, usually in test. This seems to cut down on the 'Managed Memory' that resharper/vs uses.

  3. Lastly, and sort of annoying is that I NEVER look at files under the bower_components in VS Solution explorer. I find that going to the folder directly and using something like VSCODE for JS/JSON viewing saves me time and frustration. It leads me to believe that although node_modules and bower_components are 'ignored' they aren't actually ignored or it has something to do with the sheer number of files in a project directory.

I await a solution that is 100%, but I hope these help.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionEric OuelletView Question on Stackoverflow
Solution 1 - MemorytooView Answer on Stackoverflow
Solution 2 - MemoryJohn AtwoodView Answer on Stackoverflow
Solution 3 - MemoryOgnyan DimitrovView Answer on Stackoverflow
Solution 4 - MemoryEric OuelletView Answer on Stackoverflow
Solution 5 - MemoryJoe KahlView Answer on Stackoverflow
Solution 6 - MemorygxclarkeView Answer on Stackoverflow
Solution 7 - MemoryRentering.comView Answer on Stackoverflow