How to Fix High CPU Usage by .NET Runtime Optimization Service?
High CPU Usage by the NET Runtime Optimization Service can occur unexpectedly or following an update to the .NET Framework. The related process, identified as mscorsvw.exe, appears in the Task Manager as .NET Runtime Optimization Service. This service optimizes the .NET Framework to enhance the performance of dependent applications and programs.
Officially, this process should recompile its libraries only when the computer is idle, completing in a few minutes. However, the optimization process can sometimes extend unnecessarily, with users reporting significant CPU consumption for several days.
What Causes High CPU Usage by the .NET Runtime Optimization Service?
- The process is running slowly; speeding it up might be possible by executing specific commands.
- Your computer could be hosting malware disguising itself as the service or infecting it. Running a malware scanner is recommended.
- The service could be corrupted. Restarting it might resolve the issue.
To resolve this issue, follow the methods provided below.
1. Optimize the Process Manually
Optimizing the process involves executing specific commands that prompt the .NET Runtime Optimization Service to complete its tasks more efficiently, utilizing more CPU cores if necessary.
- Search for Command Prompt via the Search button. Right-click on the top result and select Run as administrator.
- Copy and paste the following commands, hitting Enter after each. Select the command corresponding to your system architecture (32-bit for the first and 64-bit for the second).
cd c:\Windows\Microsoft.NET\Framework\v4.0.30319 cd c:\Windows\Microsoft.NET\Framework64\v4.0.30319 ngen.exe executequeueditems
- Verify if the .NET Runtime Optimization Service CPU usage has normalized.
Alternative: If you are uncomfortable running commands or are on an older Windows version, consider using Microsoft’s official script for a similar outcome.
- Open this link for the GitHub script page. Right-click the Raw button, choose Save link as…, and ensure the file type is Windows Script File (*.wsf).
- Find the file you saved and double-click to execute it. If asked which program to use, pick Windows Script Host.
- Check if the issue has been resolved.
2. Scan Your Computer for Malware
Malware infections are a common cause of this problem. Conduct a malware check on your system, as malicious software can take control of system resources and disguise itself as legitimate system files.
- Download Malwarebytes Anti-Malware from their official website by clicking here.
- Find the downloaded installer in the Downloads folder and double-click to initiate installation. Follow on-screen instructions to complete the installation process.
- Open Malwarebytes, select the Scan option, and allow time for the scan and potential database update to complete.
- Reboot your computer post-scan to determine if the .NET Runtime Optimization Service is functioning normally.
3. Restart the Service
Restarting the service can reset the .NET Runtime Optimization Service, clearing any temporary glitches or issues causing excessive CPU consumption.
- Open the Run utility using Windows Key + R, type in services.msc, and press OK to open the Services tool.
- Find the Microsoft .NET Framework NGEN v4.0.30319_X86 service (for 32-bit systems) or Microsoft .NET Framework NGEN v4.0.30319_X64 service (for 64-bit systems), right-click it, and choose Properties.
- Stop the service if it’s running, then restart it by clicking Start.
- In the service’s properties window, ensure the Startup type is set to Automatic, accepting any dialogue prompts to confirm the change.
An error message might occur upon attempting to start the service:
“Windows could not start the service on Local Computer. Error 1079: The account specified for this service differs from the account specified for other services running in the same process.”
If this issue occurs, follow these steps to resolve it:
- Repeat steps 1-3 to access the service’s properties. Proceed to the Log On tab and select Browse….
- Enter your account’s name where it states Enter the object name to select, click Check Names to validate, and press OK.
- When prompted, enter your password to start the service smoothly.
4. Perform a Clean Boot
Performing a Clean Boot can help resolve high CPU usage by starting Windows with a minimal set of drivers and startup programs, eliminating software conflicts from multiple applications and services loading during startup.
Follow our clean boot guide, then check the CPU usage. If it has lowered, a third-party application was likely responsible. You can further isolate the problematic software by reactivating applications individually.