Fix Microsoft Common Language Runtime native compiler high CPU usage

Channel:
Subscribers:
1,660
Published on ● Video Link: https://www.youtube.com/watch?v=J-OUJz8ZMxI



Duration: 1:51
96 views
0


Here's how to Fix Microsoft Common Language Runtime native compiler high CPU usage.

If you're experiencing high CPU usage caused by the "Microsoft Common Language Runtime Native Compiler," also known as mscorsvw.exe, it's a common issue that can occur after Windows updates or .NET Framework installations. This process is responsible for compiling and optimizing .NET Framework assemblies in the background to improve their runtime performance. It should normally complete its tasks and then consume minimal resources. However, if it's causing high CPU usage, you can take the following steps to address the issue:

1. **Let mscorsvw Complete**:

The mscorsvw process usually runs after Windows updates or .NET Framework installations. It may take some time to finish its compilation tasks. During this period, it might use significant CPU resources. In most cases, it should eventually complete its tasks and return to low resource usage. You can let it run in the background and wait for it to finish.

2. **Force Compilation**:

If you want to speed up the compilation process, you can manually trigger the mscorsvw process to perform its optimization. To do this, follow these steps:

a. Open a Command Prompt as an administrator.
b. Navigate to the .NET Framework directory using the command:

```
cd C:\Windows\Microsoft.NET\Framework64\v4.0.30319
```

Note: The directory path might vary based on the version of .NET Framework installed.

c. Run the following command to force compilation:

```
ngen.exe executeQueuedItems
```

3. **Use the .NET Optimization Service Tool**:

Microsoft provides a tool called "ngen.exe" that allows you to manage and optimize .NET Framework assemblies. You can use it to see the status of optimization and perform various actions. Open Command Prompt as an administrator and use the following commands:

- To check the status of optimization:

```
ngen.exe display
```

- To start the optimization:

```
ngen.exe update /force
```

- To see a list of available commands:

```
ngen.exe /?
```

4. **Disable Automatic Optimization**:

If the high CPU usage continues to be an issue, you can disable automatic optimization:

a. Open a Command Prompt as an administrator.
b. Run the following command:

```
ngen.exe executeQueuedItems /nologo
```

c. To disable automatic optimization:

```
ngen.exe queue stop
```

This will stop the background optimization process from running. Keep in mind that this might slightly impact the startup time of .NET applications.

Remember that mscorsvw.exe is a legitimate Windows process, and its optimization is designed to improve the performance of .NET Framework applications. If the high CPU usage issue persists or worsens, it might be a good idea to contact Microsoft Support or seek help from online tech communities for more specific guidance tailored to your situation.