Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a Server 2008 R2 Terminal Server that's just been kinda sitting around for the last three months with very, very low usage (perhaps 1 user for an hour, once a day).

All of a sudden, for no reason I can fathom, mscorsvw.exe (.NET Runtime Optimisation Service) has started consuming 100% of one processor, causing all sorts of alarms and triggers to go off. It's a repetative pattern, so it's quite predictable to tell when it's going to happen next:

Processor spikes caused by .net optimiser

Does anyone know what might cause this? I have done the obvious (re-started the server), but apart from that I'm SOL.

The only thing I can think of that might be relevant is I approved a half-dozen Windows Updates this morning via WSUS, but they are not due to be installed until 2am tomorrow morning (some of them were related to .NET 4 security).

Nobody is logged onto the server (except me), and even if they were, we don't have any .NET apps that are used on there.

share|improve this question
up vote 8 down vote accepted

mscorsvw is a process that pre-compiles .NET binaries. Your updates may have triggered this activity. At least, that's what says is happening.

You might get more clue what exactly is happening if you can run the sysinternals procmon utility. That will tell you what file(s) mscorsvw is hitting or focusing on, and help determine if it is actually focusing on potential .NET files.

From that website, if this is what's happening, running

ngen.exe executequeueditems

should "clear out the queue" by having it run everything at once instead of waiting for the CPU to become idle, as it appears is when this is happening on your server. Once it is done with the pre-compiling, it should stop happening.

share|improve this answer
Ugh, you're quite right. I totally forgot that that TS is set to a totally different timezone, where it IS 2am, hence the updates. And the behaviour it describes is exactly what I'm seeing, so that makes a lot of sense. Thanks. – Mark Henderson Jun 17 '11 at 1:29
No problem. I've run into that mscorsvw bugger before and that's why I suspected this was what was happening to you...I scratched my head awhile trying to figure out what that thing was doing :-) – Bart Silverstrim Jun 17 '11 at 1:31
I'm gunna flush that queue because the constant alerts is driving me nuts – Mark Henderson Jun 17 '11 at 1:33
My problem is related sql 2012, see here:… – Alexandre Jun 5 '13 at 14:26

Your Answer


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.