hogs

List the processes that are hogging the CPU

Syntax:

hogs [options] [pids ...]

Runs on:

QNX Neutrino

Options:

-i iter
Limit the output to the specified number of iterations (default: no limit).
-m [e][t][p][s]
Specify the type of memory mappings to include in the memory total for each process:
  • eMAP_ELF mappings
  • tMAP_STACK mappings
  • sMAP_SHARED mappings
  • pMAP_PRIVATE mappings (the default)

You can concatenate these types; for example, -msp gives memory for both shared and private mappings.

-p priority
Run hogs at the given priority (default: the same as the parent process).
-S [c|m|p]
Sort by:
  • c — CPU (the default)
  • m — memory
  • p — process ID
-s sec
Sleep this long between updates (default: 3 seconds).
-% num [c|m]
Show only processes that consume this percentage or more CPU (c, the default) or memory (m). 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.
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.
SYS
The amount of time that the process ran in this iteration, as a percentage of the iteration time.
MEMORY
The amount of memory that the process used. The types of mappings included depend on the -m option.
Note:
  • The SYS column is incorrect on multicore systems; the numbers in this column will add up to (roughly) the number of processors times 100%. Use the top utility instead.
  • The numbers from hogs are approximate. For more precise data, use tracelogger and the System Analysis Toolkit (see the SAT User's Guide).

Examples:

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

$ hogs -% 10c