0

My application generates a short peek of high CPU usage. When the CPU intensive task is done, I see a dropping CPU usage in Task Manager and Process Explorer for a few seconds (it forms a triangle).

I'm wondering if that CPU usage is a running average over a few seconds, which would explain this behavior, or if it's really my application that's doing something I'm not aware of, after the task is done.

I was unable to find anything about this online.

Coder14
  • 103
  • 2

1 Answers1

-1

Task Manager shows real-time usage, not Average.

The best way to measure CPU usage in your application is using Memory Profiler applications like JetBrains dotMemory or Visual Studio tools if its your own developed application.

  • Thinking about that, is that even possible? With thread switches etc, the cpu usage of a process would never be a flat line if it was really real-time. Also, if a thread is running on a core, it's using 100% of that core. So to get cpu usage of for example 5%, it needs to be an average over a certain time, right? But on what time frame is that average calculated? – Coder14 Nov 20 '19 at 09:34
  • Probably you can figure out here, Right click on Task Manager _CPU graph > Change Graph to > Logical Processors_, then you can see CPU usage per core. And when run your application, just follow whats happenings per CPU usage. I think average must be calculated per second. –  Nov 20 '19 at 09:51
  • You can read more about time calculation: [Analyze the CPU Usage report](https://docs.microsoft.com/en-us/visualstudio/profiling/cpu-usage?view=vs-2019#BKMK_Call_tree_data_columns) –  Nov 20 '19 at 10:10