smwikipedia
smwikipedia

Reputation: 64175

How to detect the performance issue of a multi-threaded C# application?

I have a multi-threaded C# application. Most of the time all the CPU cores are occupied 100%. But during a certain period, the CPU sage drop down to <30%, how can I detect what cause this?

And How can I identify the code consuming the CPU much?

Upvotes: 0

Views: 188

Answers (1)

Emond
Emond

Reputation: 50672

In Visual Studio you can set a breakpoint and use the parallel stacks viewer. and here

You could also create a memory dump of the process (using the task manager) and have a look at the threads in visual Studio or open the dump in WinDBG.

WinDBG is very useful when the process is stuck or when you want to have a look at either memory and/or find threads that are deadlocked

Upvotes: 1

Related Questions