5

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.

Mark Henderson
  • 68,316
  • 31
  • 175
  • 255

1 Answers1

8

mscorsvw is a process that pre-compiles .NET binaries. Your updates may have triggered this activity. At least, that's what http://blogs.msdn.com/b/davidnotario/archive/2005/04/27/412838.aspx 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.

Bart Silverstrim
  • 31,092
  • 9
  • 65
  • 87
  • 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 01: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 01:31
  • I'm gunna flush that queue because the constant alerts is driving me nuts – Mark Henderson Jun 17 '11 at 01:33
  • My problem is related sql 2012, see here: http://dba.stackexchange.com/questions/30448/how-do-i-fix-sql-server-assembly-optimization-errors-and-memory-exhaustion – Alexandre Jun 05 '13 at 14:26