Go Premium for a chance to win a PS4. Enter to Win


NGen failes with out of Memory error

Posted on 2014-03-09
Medium Priority
Last Modified: 2014-04-14
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
Question by:Julian Hansen
LVL 50

Expert Comment

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

LVL 44

Expert Comment

by:Davis McCarn
ID: 39918890
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.
LVL 60

Author Comment

by:Julian Hansen
ID: 39920361
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.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 44

Expert Comment

by:Davis McCarn
ID: 39920512
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.
LVL 60

Author Comment

by:Julian Hansen
ID: 39920699
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.
ScreenshotThat 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.
LVL 44

Accepted Solution

Davis McCarn earned 1500 total points
ID: 39920832
One (or more) of your .NET installations is corrupt and it gets a bit risky fixing it; but, I have done it more than 50 times.
I would uninstall VS2010 and NGEN then try uninstalling each version of .Net.  Hopefully; they will all go away nicely; but, I'll bet one or more won't.
For those that don't , here is a cleanup tool and an article on how to use it including reinstalling .NET: http://blogs.msdn.com/b/astebner/archive/2008/08/28/8904493.aspx
LVL 60

Author Comment

by:Julian Hansen
ID: 39921177
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.
LVL 44

Expert Comment

by:Davis McCarn
ID: 39921557
NGen requires that .NET be up and operational......
LVL 59

Expert Comment

ID: 39975417
I've requested that this question be deleted for the following reason:

Not enough information to confirm an answer.
LVL 60

Author Comment

by:Julian Hansen
ID: 39975418
Question has not been abandoned - I am still working on the problem.

I will close this question once I have exhausted all options.
LVL 60

Author Closing Comment

by:Julian Hansen
ID: 40000099
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.

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

972 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question