NGen failes with out of Memory error
Posted on 2014-03-09
I have a problem that has been around for some time. A while back I installed VS 2010 and MVC along with TeamViewer and some other VS components. At some point during this install something went wrong - most likely with the MVC Tools Update install.
The install would take several hours to complete - afterwhich it was found not to be on the system - after doing the install twice - I checked the logs and found it was terminating with an error and rolling back.
Since then anything that requires .Net 2 or 4 takes an age to install.
Pattern is this
Install script kicks of NGen install command.
Memory utilisation starts to climb rapidly until it is over 3GB.
Disk drive goes bananas for 2-10 minutes
Memory released only to start again with next NGen command.
NGen log shows command followed by 'Out of Memory' followed by NGen returned 0xffffffff
Sometimes packages install correctly.
Uninstalling a package takes just as long. For some reason NGen /uninstall goes through the same process as NGen install - massive memory consumption, high disk activity. Odd given uninstall should just be a delete.
As an indication - VS2010 took 9 hours to uninstall.
I also had to disable the MSCORSVW service - as it was continually trying to recompile assemblies - each of which goes through the process above - never completes i.e. when done /update runs again because previous failed.
I have tried removing all packages back to the pre-2010 install. I have also done a repair on all .Net installs.
Found nothing on Google - except a few similar references with the only solution to rebuild OS - which is not an option.
Any ideas as to what be causing this