Back in the Java world I was able to specify that the JVM should create a heap dump file on the first OutOfMemoryError. Is there anything equivalent in C#?
A heap dump would be ideal but I'd settle for a histogram.
If there's no way to do this automatically is there a way to hook this exception and then walk the heap manually?