The following threads in Zetta_160502_185436.dmp are waiting for .net garbage collection to finish. Thread 105 triggered the garbage collection.The gargage collector thread wont start doing its work till the time the threads which have pre-emptive GC disabled have finished executing. The following threads have pre-emptive GC disabled 105.
Thread 105 is the only thread that is not Preemptive. It is listed as Cooperative.
Looking at the call stack for thread 105, it makes a call to the PerformanceCounter NextValue() method, which ultimately calls RegistryKey.InternalGetValue. In that method it creates a large byte array, with a size of at least 65,000 bytes. I think this is where the additional memory is needed, hence triggering the garbage collection. Thing is, I don’t see anywhere that would be changing the GC Mode.
My questions are:
How can a given thread be waiting on itself before GC begins?
How did the GC Mode of the thread get changed to Cooperative?
What I have tried:
We keep getting out of memory exceptions because of this condition, but I don’t know what to change to fix it.