NGen failes with out of Memory error

Posted on 2014-03-09
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 48

Expert Comment

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

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 56

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 to run the silent repair option for .Net - made no difference.
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

LVL 43

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 56

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 43

Accepted Solution

Davis McCarn earned 500 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:
LVL 56

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 43

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 56

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 56

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

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

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

In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

756 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