ronaldosantana
ronaldosantana

Reputation: 5252

Debug Delphi multi-thread app - how to get the one consuming 100% CPU

I'm debugging a multi-thread delphi app. We are having a trouble that, after connect to the server, the client app is getting 100% of the CPU. Is there a way for me to debug and know shich thread is dois that?

Upvotes: 4

Views: 906

Answers (2)

Paul Sasik
Paul Sasik

Reputation: 81429

Process Explorer will give you usage details down to the thread level for any process.

  1. Run your app
  2. Run Process Explorer (after downloading it ;-)
  3. Double click on your executable in the process list
  4. Select the Threads tab and there you will see:
    1. The Thread ID
    2. CPU Usage
    3. Cycles Delta
    4. And the start address

The TID ought to be enough to nail down your CPU hogging thread.

Upvotes: 8

Brian
Brian

Reputation: 25834

As Paul Sasik suggests, Process Explorer is probably what you want to do. If your debugging strategy involves monitoring code that is in your application itself, use GetThreadTimes.

Upvotes: 3

Related Questions