[Previous] [Contents] [Index] [Next]

Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

hogs

List the processes that are hogging the CPU

Syntax:

hogs [options] [pids ...]

Options:

-n
Show the names of processes (hogs always displays the process IDs).
-p priority
Run hogs at the given priority (default: the same as the parent process).
-s sec
Sleep this long between updates (default: 3 seconds).
-% num
Show only processes that consume this percentage or more CPU. You can use this option to reduce the amount of output.

Description:

The hogs utility displays a list of processes in descending order by percentage of CPU usage (i.e. it shows who's hogging the processor). It loops forever, sleeping between updates.

The format of the output is tabular, and includes:

PID
The ID of the process being reported.
NAME
The name of the process (included only if you specify the -n option).
MSEC
The number of milliseconds for which this process has been running since the last iteration.
PIDS
The amount of time that the process ran in this iteration, as a percentage of the times of all the other processes running.
SYSTEM
The amount of time that the process ran in this iteration, as a percentage of the iteration time.

Examples:

Display the processes that are using 10% or more of the CPU. Include the name of the processes:

$ hogs -n -% 10
PID             NAME  MSEC  PIDS SYSTEM
1                      451   41%    15%
6          devb-eide   141   13%     4%
8             fs-pkg   391   36%    13%

1                      570   33%    19%
6          devb-eide   208   12%     6%
8             fs-pkg   798   47%    26%

1                      488   32%    16%
6          devb-eide   203   13%     6%
8             fs-pkg   667   44%    22%

This sample includes three iterations.

See also:

pidin, psin, sin

Fine-Tuning Your System in the Neutrino User's Guide


[Previous] [Contents] [Index] [Next]