2

I would like to debug and identify a memory leak in one/some of the threads in a C++ process. I would like to get a thread dump of the process once the memory usage is very high.

I know for java the following commands work, 'kill -3 ' [linux] or 'sendsignal.exe ' (http://www.latenighthacking.com/projects/2003/sendSignal/)

Is there any way to a get thread dump for C++ process on Windows.

can this thread be related: How to programmatically cause a core dump in C/C++

Thank you.

Community
  • 1
  • 1
oakist
  • 161
  • 1
  • 3
  • 9

2 Answers2

5

Minidump, not "thread dump". It is built into Taskmgr.exe for Vista and Win7. Right-click the process in the Processes tab, Create Dump File. All the different ways are listed here.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
1

You can also generate memory dumps (mini-dumps) based on performance counters (handle count, memory consumption) automatically using procdump from SysInternals: http://technet.microsoft.com/en-us/sysinternals/dd996900

You can then load and analyze the generated file(s) in WinDbg (or in VS2010 which can now also load memory dumps)

floyd73
  • 1,240
  • 9
  • 12