tags:

views:

189

answers:

3

I am wondering if there is a tool that allows to track intermittent OutOfMemoryExceptions in C# code.

Ideally, I am looking for something that would detect OOM situation and once it happens, it would allow viewing the content of the managed heap.

I usually use WinDBG + SOS extension to view the heap state. The problem with this approach is that my problem is intermittent and I don't have a dump file when the exception happens. Also traversing the heap in WinDBG is not really user friendly experience.

+2  A: 

Take a look at JetBrains dotTrace Profiler.

Robert S.
A: 

Is it that you want to track this exception or you want to identify the cause? I've use AQTime to hunt down memory leaks in managed/unmanaged code with a fair amount of success.

plinth
A: 

I would say that WinDbg + SOS is a good combination for this, but I'll give you that it is not the most attractive user experience.

My suggestion is that you set up your just in time debugger to create a crash dump and then use WinDbg to find the error.

Be aware that a crash dump for an out of memory exception may be huge.

Brian Rasmussen