TLDR: I want to reproducibly capture a crash dump in the middle of a garbage collection.
Details:
In order to be able to better help other people answering questions related to crash dumps that were taken during the process of garbage collection *), I am looking for a way to capture example dumps while .NET is doing garbage collection.
I am not looking for a single "open source" dump which has that effect. Instead I'd like to be able to make it reproducible, so I can capture a series of crash dumps, because I want
- different operating systems (Vista, 7, 8, 8.1, 10)
- different CLRs (2.0, 4.0)
- different architectures (x86, x64)
- different modes (debug, release)
So an answer should consist of two parts:
- a demo .NET program that allocates memory and does garbage collection
- a command or batch script that captures a crash dump at the right time (e.g. using ProcDump)
*)
We have this question which is about analyzing a crash dump that was captured during a garbage collection.
We also have a question asking the opposite: How to capture a crash dump when it is not in the middle of garbage collection.