ExecutionEngineException occurs during Garbage Collection

Not sure if this is the right fix? We've added this issue to our memory dump diagnostic which can confirm.


An x64 .Net 4 application crashes randomly.


This bug can be encountered when the Garbage Collector is freeing and compacting memory. The error can happen when the Concurrent Garbage Collection is enabled and a certain combination of foreground Garbage Collection and background Garbage Collection occurs. When this situation happens you will see the same call stack over and over. On the heap you will see one free object and before it ends you will see another free object corrupting the heap.


Disable the concurrent GC as explained in the following document:

How to: Disable Concurrent Garbage Collection