I have a c++ windows application that leaks memory per transaction. Using perfmon I can see the private bytes increase with every transaction, the memory usage is flat while the application is idle.
Following previous answers on stackoverflow I used umdh from the microsoft debugging tools to track down one memory leak. However there is still more leaks and the results of umdh don't match up with my perfmon results.
First umdh does still reports this leak, the stack trace is:
+ 36192 ( 2082056 - 2045864) 251 allocs BackTraceCB
+ 4 ( 251 - 247) BackTraceCB allocations
ntdll!RtlAllocateHeapSlowly+00000041
ntdll!RtlAllocateHeap+00000E9F
MSVCR80!malloc+0000007A
This is no use as the first call is malloc, it doesn't say what called it. I have my doubts about this leak as it is reported both when the application is processing transactions and when it is idle. But I can clearly see that no memory is leaking when it is idle. And the memory leaks reported when processing the transactions are not proportional to the transactions processed as perfmon reports.
umhd does not show any other leaks, although I know there is at least one more not shown. I have just learn from searching the net that a windows application can have multiple heaps.
- Could it be that umhd only reports memory usage from one of these heap? eg the default or crt heap?
- How can I track memory usage in other heaps?
- And how do find out what dlls / modules are using the other heaps?
Any pointers to tracking down this problem would be gratefully received as I am running out of options.