High CPU usage by .NET Runtime Optimization Service fix

How to fix .NET Runtime Optimization Service high CPU usage

In certain scenarios, some Windows processes or third-party applications can trigger high CPU usage. If you open Task Manager to check which process is slowing down your computer, you may be surprised to see .NET Runtime Optimization Service utilizing much of your CPU’s resources. It’s a known issue that .NET Runtime Optimization Service can randomly, but also after an update to .NET Framework, start utilizing an unreasonable amount of a computer’s CPU processing power. Here, we will discuss this issue and provide proven methods on how to fix this issue.

Windows 10 consists of many services that make it and its programs work correctly. .NET Runtime Optimization Service is a component of the Windows operating system. Its executable is called mscorsvw.exe, but you will typically see it in Task Manager as .NET Runtime Optimization Service.

Net Runtime Optimization Service high CPU usage fix

This service aims to optimize .NET Framework, which, in turn, optimizes applications that require .NET Framework to launch and run faster. It features native image generation technology, allowing applications to launch quickly. Without .NET Runtime Optimization Service, your applications wouldn’t launch as fast.

While your PC is idle, .NET Runtime Optimization Service recompiles .NET assemblies in the background. Microsoft has stated that the service should run no longer than a few minutes.

Under normal conditions, .NET Runtime Optimization Service doesn’t cause high CPU usage. However, if, for some reason, the process takes longer than it should, that might cause this service to utilize more CPU resources than necessary. In such an event, this service might use up to 100% of your CPU’s resources. You may see multiple .NET Runtime Optimization Service (mscorsvw.exe) processes when you open Task Manager.

Furthermore, this may not be limited to the CPU, but also RAM. Suppose .NET Runtime Optimization Service utilizes all of the available memory. In that case, your PC can slow down to a crawl and become unusable.

.NET Runtime Optimization Service was configured to run in the background always. When it detects your PC is idle, it starts recompiling framework libraries. It is said that the recompiling process takes between 5-10 minutes. The problem many users have experienced is that .NET Runtime Optimization Service runs the optimization process for too long and consumes a large percentage of a CPU’s resources when it runs. Some users have reported that NET Runtime Optimization Service would stay like that for days and even weeks without ever completing its processes.

There are a few less likely reasons for why .NET Runtime Optimization Service causes high CPU utilization. First, the optimization process runs too slow, taking more than the usual 5-10 minutes to complete its task. Second, the service might have been corrupted and needs to be restarted. Third, .NET Runtime Optimization Service might have been infected by malware. Alternatively, your PC might have been infected with malware disguised as .NET Runtime Optimization Service.

Before you attempt to tackle the issue of .NET Runtime Optimization Service hogging your CPU’s resources, you should install anti-malware software and scan your computer for threats that may have been disguised as this service. We don’t recommend disabling .NET Runtime Optimization Service permanently as it’s vital to launching applications on your PC much faster.

Nevertheless, you can temporarily terminate the service via Task Manager. Doing so will temporarily turn off the service, but it will come back later when your PC is idle again.

Table of Contents:

Method 1. Optimize NET Runtime Optimization Service

1. Hold down Windows+R keys to open Run.

Open run and enter CMD

2. Type CMD and hold down Shift+Ctrl+Enter keys to open Command prompt with administrative privileges.

Type in the command and hit Enter

3. Type in the cd c:\Windows\Microsoft.NET\Framework64\v4.0.30319 command in the Command prompt and hit Enter.

Note: If you’re running the 32-bit version of Windows type in cd c:\Windows\Microsoft.NET\Framework\v4.0.30319 instead and hit Enter.

Type in ngen.exe executequeueditems and hit Enter

4. Then, type in ngen.exe executequeueditems and hit Enter.

[Back to Table of Contents]

Method 2. Run the .Net Runtime Optimization speed up script

Go to the GitHub link to download the script by Microsoft

1. Go to Microsoft's GitHub page to download the official script.

Right-click Raw and click Save link as

2. Right-click the Raw button and select Save link as.

Save as Windows Script File

3. Make sure that the Save as type is Windows Script file and click Save to download DrainNGenQueue on your PC.

Open DrainNGenQueue

4. Then, open the script file, and the Command prompt will execute the script and close automatically.

[Back to Table of Contents]

Video on how to fix high CPU usage by .NET Runtime Optimization Service:

[Back to Top]

About the author:

Tomas Meskauskas

I am passionate about computer security and technology. I have an experience of 10 years working in various companies related to computer technical issue solving and Internet security. I have been working as an editor for pcrisk.com since 2010. Follow me on Twitter to stay informed about the latest tech news or online security threats. Contact Tomas Meskauskas.

Our guides are free. However, if you want to support us you can send us a donation.