Tracking OutOfMemoryExceptions in C # Code

I'm wondering if there is a tool out there that lets you track intermittent OutOfMemoryExceptions in C # code.

Ideally, I am looking for something to detect the OOM situation, and once that happens, it will allow me to view the contents of the managed heap.

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

+1


source to share


3 answers


Take a look at JetBrains dotTrace Profiler .



+2


source


Do you want to track this exception or do you want to determine the cause? I have been using AQTime to find memory leaks in managed / unmanaged code with sufficient success.



0


source


I would say that WinDbg + SOS is a good combination for this, but I will let you know that it is not the most attractive user interface.

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

Be aware that the crash for an out of memory exception can be huge.

0


source







All Articles