During an Exchange CU update we were getting the below message
Prior to this all the Exchange servers were fully patched including the latest .net assemblies since it was CU5 upgrade.
If we look into the task manager we can see this process running and consuming large CPU resources. This is a .net related process that does the compilation job based on the priorities it is having high priority assemblies and low priority assemblies.
What is MSCORSVW.exe?
The .Net framework has technology called Native Image Generator Technology (NGEN) which will speed up the process for .net apps which will run only on a periodic basis purely to improve the performance of that machine
This process MSCORSVW.exe is used by NGEN to improve the startup performance of .NET apps. So probably after an windows update especially .net patch if we have we can see this process running only at that time and consuming more CPU.
Solution for this problem:
- Solution 1: We can wait for a while for this .net compilation job to complete probably 5 or 10 minutes time. Once completed if we rerun the setup things will go fine.
- Solution 2: By default, NGEN only uses one CPU core for this operation . There is an option to make this work done quickly by making it to use up to 6 cores when we require them. By doing this it will complete its compilation job quickly.
Open CMD in elevated mode and run this command from this path
c:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe executeQueuedItems
Running the above will Execute queued compilation jobs with extra CPU cores and make it faster.Now wait for the process to precompile all the assemblies, after a couple of minutes it will be completed.
There will be ngen log as well generated in the same location where we executed this command which we can have a look at after the job completes.
References:
https://msdn.microsoft.com/en-us/library/6t9t5wcf(v=vs.110).aspx
https://blogs.msdn.microsoft.com/dotnet/2013/08/06/wondering-why-mscorsvw-exe-has-high-cpu-usage-you-can-speed-it-up/
Thanks & Regards
Sathish Veerapandian
Thank you for sharing, This helped
LikeLike