CLR memory profiling

Sunday, September 24, 2006 0 Comments

On friday Rubén was trying to profile our server looking for memory leaks detected on the release stress tests. Apparently one task had introduced something that didn't get freed up on nearly every command, making the server memory grow to the point where system ran out of memory under heavy stress testing.

This should be easy to detect with a profiling tool but, to our surprise, memory profiling on .net is not that easy. After trying with 3 comercial profilers, our best result was a map of about 10% of the total memory the process was consuming. Quite frustrating.

Some googling, however, got us to the windbg SOS extension, a helper dll to debug managed programs with windbg. Just loading the process in the debugger, issuing a "DumpHeap -stat" command, and we had the heap content that apparently no comercial profiler was able to get. Have fun.

0 comentarios: