OK, I realize that question might seem weird, but I just noticed something that really puzzled me... Have a look at this code :
static void TestGC()
{
The garbage collector gets lifetime hints from the JIT compiler. It thus knows that at the GC.Collect() call there are no more possible references to the local variables and that they therefore can be collected. Review GC.KeepAlive()
When a debugger is attached, JIT optimization is disabled and the lifetime hint gets extended to the end of the method. Makes debugging a lot simpler.
I wrote a much more detailed answer about this, you'll find it here.