Link to home
Start Free TrialLog in
Avatar of Julian Hansen
Julian HansenFlag for South Africa

asked on

NGen failes with out of Memory error

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.

No joy.

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
Avatar of dbrunton
dbrunton
Flag of New Zealand image

Just a wild try, try verifying your .NET installation with the Aaron Stebner tool.

http://blogs.msdn.com/b/astebner/archive/2008/10/13/8999004.aspx
Go to Add or Remove Programs in the Control Panel.  Locate the .Net entries, highlight each in turn, and, on most, if you click the support link, there will be a repair option.  If it works, great; otherwise, note that version and try all of them.
For any which could not be repaired, use the removal tool from dbruton's post to remove that version of .NET.
Then, download and reinstall those versions.
Avatar of Julian Hansen

ASKER

Thanks for the response.

@dbrunton - downloaded and verified each of the installations - all passed

@DavisMcCarn - I had already tried this - .Net does not offer a repair. If you go to Add / Remove programs and click  Change / Remove it asks if you want to uninstall - if you say yes you get a message that .Net can't uninstall because other apps depend on it.

I used the instructions here http://blogs.msdn.com/b/astebner/archive/2010/05/12/10011664.aspx to run the silent repair option for .Net - made no difference.
Do Start and, in the run box, type %temp%<enter>
In the window which appears should be the logs for .NET's installations which you need to inspect.  As a note, the last thing I think you wanted was a "silent" reinstall; you wanted to see the errors.

On my own PC I have .NET 2, 3, 3.5, and 4.  2 has a repair option in "Click here for support information".  All of the others have it under Change/Remove.
The change option is available on 2 upwards it seems. Clicking it resulted in the following
RAM usage went up to 3.8GB from 1.1GB (see image)
The dialog in the screen shot below was on screen for more than 10 minutes while the disk did gymnastics.
User generated imageThat was all that was displayed - after approx 12 minutes the disk quieted down and the dialog dissappeared - nothing else displayed

Same problem seems to exist after having done that.

The question is - is a .Net install just a memory hungry beast or is it just my installation.

I know for a fact there were no issues prior to the VS2010 install - the NGen logs show no Out of Memory errors prior to the install of VS2010 but they are all over the place after that. I also know that installations prior to VS2010 being installed did not take 8 hours to install and definitely did not take that length of time to uninstall.

Still can't figure out why NGen has to work so hard on an uninstall.
ASKER CERTIFIED SOLUTION
Avatar of Davis McCarn
Davis McCarn
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I would uninstall VS2010
Already did that - took 9 hours - no joy.

Uninstall NGen - thought NGen was part of .Net? How do you uinstall it without removing .Net

Will try the cleanup tool.
NGen requires that .NET be up and operational......
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
Question has not been abandoned - I am still working on the problem.

I will close this question once I have exhausted all options.
I have given up on resolving this. Have acquired a new PC.

I did follow the instructions posted by Davis - and this had some limited effect in that mscorsvw stopped misbehaving - but still cannot uninstall certain apps without it taking hours.

I have awarded a B to the solution - not to the expert - as the solution partially deals with the problem but did not yield a definitive answer. It may be useful to others reading this post.

@Davis - thanks for the input and effort - appreciate it - looks like Microsoft wins this round though.