Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

The .NET Runtime Optimization Service (mscorsvw) keeps consuming all my workstation's memory since I installed SQL Server 2012 Service Pack 1.

It consumes about 1.6 GB of memory before exhausting all available memory:

.NET Runtime Optimization Service consumes all available memory on my workstation.

I can kill the process, but it happens again when I restart my computer or wait long enough.

Techdows suggests using the .NET Native Image Generator (ngen) to solve the problem.

I oipened a Command Prompt and ran commands like this:

cd C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319.1
ngen executeQueuedItems

The memory consumption of mscorsvw dropped to about 20-30 MB, and ngen consumed all the remaining memory.

ngen generated only error messages until I killed the process. The first few lines of output looked like this:

Microsoft (R) CLR Native Image Generator - Version 4.0.30319.1
Copyright (c) Microsoft Corporation.  All rights reserved.
Failed to load dependency Microsoft.DataWarehouse of assembly
Microsoft.SqlServer.MaintenancePlanTasks, Version=11.0.0.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91 because of the following error : The system
cannot find the file specified. (Exception from HRESULT: 0x80070002)
Failed to load dependency Microsoft.VisualStudio.DataTools.Interop of assembly 
Microsoft.DataWarehouse, Version=11.0.0.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91 because of the following error : The system
cannot find the file specified. (Exception from HRESULT: 0x80070002)
Failed to load dependency Microsoft.Data.ConnectionUI of assembly
Microsoft.DataWarehouse, Version=11.0.0.0, Culture=neutral,
PublicKeyToken=89845dcd8080cc91 because of the following error : The located
assembly's manifest definition does not match the assembly reference.
(Exception from HRESULT: 0x80131040)

All the messsages say either that the system could not find an assembly, or that a manifest definition does not match a reference.

As a workaround, I have disabled the Windows Services clr_optimization_v4.0.30319_32 and clr_optimization_v4.0.30319_64.

This hides the problem rather than solving it, and stops all .NET assemblies from being optimized.

What else can I try to solve this problem?

share|improve this question
    
Have you tried re-installing the .Net runtime? –  Max Vernon Dec 14 '12 at 15:45
    
@MaxVernon Not yet. That could take a while. I'll try that next week if no other solution presents itself. –  Iain Elder Dec 14 '12 at 15:50
    
Apparently, not as long as getting another answer. Did you try re-installation? –  Max Vernon Dec 20 '12 at 21:36
add comment

1 Answer

up vote 6 down vote accepted

This problem is described on Connect (see msiexec.exe processes keep running after installation of SQL Server 2012 SP1) and a hotfix is available at KB2793634. There is commentary on work-arounds on Connect and this blog if you are unable to install the hotfix immediately.

I chose to setup 2 scripts. 1st script runs daily at 1am, and set to terminate after 1 hour of execution

c:\windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe executequeueditems
c:\windows\Microsoft.NET\Framework\v2.0.50727\ngen.exe executequeueditems
c:\windows\Microsoft.NET\Framework64\v2.0.50727\ngen.exe executequeueditems 
c:\windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe executequeueditems

2nd script runs daily at 3am (and whenever the computer restarts):

c:\windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe queue pause
c:\windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe queue pause

This way I still get compile optimization jobs (only run during off-peak hours), but the mscorsvw/msiexec process is tamed.

share|improve this answer
    
I haven't tested your scripts. On my workstation I was able to install the hotfix immediately, and it has solved my problem! Thanks for the reference. –  Iain Elder Jan 7 '13 at 11:16
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.