Tracking CPU and Memory usage per process

前端 未结 16 2037
粉色の甜心
粉色の甜心 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:55

    I agree, perfmon.exe allows you to add counters (right click on the right panel) for any process you want to monitor.

    Performance Object: Process Check "Select instances from list" and select firefox.

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

    maybe you can use this. It should work for you and will report processor time for the specified process.

    @echo off
    : Rich Kreider <rjk@techish.net>
    : report processor time for given process until process exits (could be expanded to use a PID to be more
    : precise)
    : Depends:  typeperf
    : Usage:  foo.cmd <processname>
    
    set process=%~1
    echo Press CTRL-C To Stop...
    :begin
    for /f "tokens=2 delims=," %%c in ('typeperf "\Process(%process%)\%% Processor Time" -si 1 -sc 1 ^| find /V "\\"') do (
    if %%~c==-1 (
    goto :end
    ) else (
    echo %%~c%%
    goto begin
    )
    )
    
    :end
    echo Process seems to have terminated.
    
    0 讨论(0)
  • 2020-11-28 01:59

    Perfmon.exe is built into windows.

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

    Under Windows 10, the Task Manager can show you cumulative CPU hours. Just head to the "App history" tab and "Delete usage history". Now leave things running for an hour or two:

    What this does NOT do is break down usage in browsers by tab. Quite often inactive tabs will do a tremendous amount of work, with each open tab using energy and slowing your PC.

    0 讨论(0)
  • 2020-11-28 02:00

    Process Explorer can show total CPU time taken by a process, as well as a history graph per process.

    0 讨论(0)
  • 2020-11-28 02:08

    Although I have not tried this out, ProcDump seems like a better solution.

    Description from site:

    ProcDump is a command-line utility whose primary purpose is monitoring an application for CPU spikes and generating crash dumps during a spike that an administrator or developer can use to determine the cause of the spike. ProcDump also includes hung window monitoring (using the same definition of a window hang that Windows and Task Manager use), unhandled exception monitoring and can generate dumps based on the values of system performance counters. It also can serve as a general process dump utility that you can embed in other scripts.

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