Reputation: 64175
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
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