Tracking CPU and Memory usage per process

前端 未结 16 2036
粉色の甜心
粉色の甜心 2020-11-28 01:28

I suspect that one of my applications eats more CPU cycles than I want it to. The problem is - it happens in bursts, and just looking at the task manager doesn\'t help me as

相关标签:
16条回答
  • 2020-11-28 01:47

    I use taskinfo for history graph of CPU/RAM/IO speed. http://www.iarsn.com/taskinfo.html

    But bursts of unresponsiveness, sounds more like interrupt time due to a falty HD/SS drive.

    0 讨论(0)
  • 2020-11-28 01:49

    Process Lasso is designed more for process automation and priority class optimization, not graphs. That said, it does offer per-process CPU utilization history (drawn as a white line on the graph) but it does NOT offer per-process memory utilization history.

    DISCLAIMER: I am the author of Process Lasso, but am not actually endorsing it here - as there are better solutions (perfmon being the best).

    The best thing ever is Windows Vista+ Resource and Performance Monitor. It can track usage of CPU, Memory, Network, and Disk accesses by processes over time. It is a great overall system information utility that should have been created long ago. Unless I am mistaken, it can track per-process CPU and memory utilization over time (amongst the other things listed).

    0 讨论(0)
  • 2020-11-28 01:49

    You can also try using a C#/Perl/Java script get the utilization data using WMI Commands, and below is the steps for it.

    We need to execute 2 WMI Select Queries and apply CPU% utilization formula

    1. To retrieve the total number of logical process

    select NumberOfLogicalProcessors from Win32_ComputerSystem
    

    2. To retrieve the values of PercentProcessorTime, TimeStamp_Sys100NS ( CPU utilization formula has be applied get the actual utilization percentage)and WorkingSetPrivate ( RAM ) minimum of 2 times with a sleep interval of 1 second

    select * from Win32_PerfRawData_PerfProc_Process where IDProcess=1234
    

    3. Apply CPU% utilization formula

    CPU%= ((p2-p1)/(t2-t1)*100)/NumberOfLogicalProcessors
    

    p2 indicated PercentProcessorTime retrieved for the second time, and p1 indicateds the PercentProcessorTime retrieved for the first time, t2 and t1 is for TimeStamp_Sys100NS.

    A sample Perl code for this can be found in the link http://www.craftedforeveryone.com/cpu-and-ram-utilization-of-an-application-using-perl-via-wmi/

    This logic applies for all programming language which supports WMI queries

    0 讨论(0)
  • 2020-11-28 01:51

    Using perfmon.exe, I have tried using the "Private Bytes" counter under "Process" counters for tracking memory usage and it works well.

    0 讨论(0)
  • 2020-11-28 01:54

    Just type perfmon into Start > Run and press enter. When the Performance window is open, click on the + sign to add new counters to the graph. The counters are different aspects of how your PC works and are grouped by similarity into groups called "Performance Object".

    For your questions, you can choose the "Process", "Memory" and "Processor" performance objects. You then can see these counters in real time

    You can also specify the utility to save the performance data for your inspection later. To do this, select "Performance Logs and Alerts" in the left-hand panel. (It's right under the System Monitor console which provides us with the above mentioned counters. If it is not there, click "File" > "Add/remove snap-in", click Add and select "Performance Logs and Alerts" in the list".) From the "Performance Logs and Alerts", create a new monitoring configuration under "Counter Logs". Then you can add the counters, specify the sampling rate, the log format (binary or plain text) and log location.

    0 讨论(0)
  • 2020-11-28 01:54

    Download process monitor

    1. Start Process Monitor

    2. Set a filter if required

    3. Enter menu Options > Profiling Events

    4. Click "Generate thread prof‌iling events", choose the frequency, and click OK.

    5. To see the collected historical data at any time, enter menu Tools > Process Activity Summary

    0 讨论(0)
提交回复
热议问题