AC.
AC.

Reputation: 754

How to print execution stack of threads while they are consuming lots of CPU?

Does anybody know how to achive the following task.

Application sometimes eats lots of CPU, ProcessExplorer (procexp.exe) shows periodical high kernel CPU load (~60-80). I see in procexp that some threads do something that consumes lots of kernel time. In that moment I would like to print execution stack of those busy threads.

Is there any monitoring tool that can show that kind of information or some WinDbg script, etc?

Upvotes: 1

Views: 140

Answers (2)

jcopenha
jcopenha

Reputation: 3975

I would suggest using ProcDump.

A command like:

procdump -c 60 -s 3 -ma -n 5 -x Your.exe your.dmp

Which will take a full memory dump when the process exceeds 60% CPU utilization for 3 consecutive seconds and do that up to 5 times. This way you can compare the different dumps and see where the process is spending its time.

Upvotes: 2

Kjell Gunnar
Kjell Gunnar

Reputation: 3067

One opportunity is to use the ProcDump from sysinternals to take dumps when CPU load exceed a limit you specify. http://technet.microsoft.com/en-us/sysinternals/dd996900
Or you can look in the windbg help for “Tracking Down a Processor Hog”

Upvotes: 1

Related Questions