Umdh.exe - A Relatively Unknown Tool
Most investment bank software engineers don't know about Microsoft's Umdh.exe. UMDH is included with the Debugging Tools for Windows product, and provides Windows heap analysis - very useful for looking for memory leaks. We found UMDH particularly useful in tracking down a memory leak in a trading application that used Visual C++ (managed/unmanaged) code and C#.
Prior to running Umdh.exe on a Windows process, ensure the environment variable _NT_SYMBOL_PATH is set. Also, turn on stack tracing using: 'gflags -i <AppName> +ust' to get output like this:
000002E8 bytes by: BackTrace11817
system.xml!??? @ 7BD760DD
UMDH allows log file comparison, allowing easy identification of what memory allocations occurred between two points in time:
// Each log entry has the following syntax:
// + BYTES_DELTA (NEW_BYTES - OLD_BYTES) NEW_COUNT allocs BackTrace TRACEID
// + COUNT_DELTA (NEW_COUNT - OLD_COUNT) BackTrace TRACEID allocations
// ... stack trace ...
// BYTES_DELTA - increase in bytes between before and after log
// NEW_BYTES - bytes in after log
// OLD_BYTES - bytes in before log
// COUNT_DELTA - increase in allocations between before and after log
// NEW_COUNT - number of allocations in after log
// OLD_COUNT - number of allocations in before log
// TRACEID - decimal index of the stack trace in the trace database
// (can be used to search for allocation instances in the original
// UMDH logs).
+ 5d0 ( 8b8 - 2e8) 3 allocs BackTrace11817
+ 2e8 ( 5d0 - 2e8) 2 allocs BackTrace11819
I'm unsure if this was an issue with my install, but whenever System.xml appeared in the stack trace, there was always a ???? for the function name (possibly due to the call being managed code):
VaDump is another utility that appears useful. Does anyone have any experience of VaDump?