Search code examples
windbgsos

GC vs GC SuspendedEE


When I run !threads -special command, I get following. There are other lines also in output that i have removed for brevity.

OSID     Special thread type  

15 26ec GC SuspendEE
15 3174 GC

Any ideas what is the difference between GC and GC SuspendedEE


Solution

  • In server type GC you can have multiple GC threads -- more exactly one thread per processor. The way server GC works if one of the threads stops CLR execution engine (EE) so that GC threads could safely move objects around. Only one thread is supposed to stop EE, and GC thread #0 always does this. The same thread is responsible for resuming EE after GC cycle completes.

    The presence of "GC SuspendEE" in the !threads -special output means two things:

    1. This is GC thread #0
    2. The GC cycle is currently executing. Once finished, the SuspendEE flag will be cleared from this thread.