0

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?

smwikipedia
  • 61,609
  • 92
  • 309
  • 482

1 Answers1

1

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

Community
  • 1
  • 1
Emond
  • 50,210
  • 11
  • 84
  • 115