top

QNX SDP8.0Utilities ReferenceUtilities

Display system usage (Unix)

Syntax:

top [-bdt] [-D delay] [-i number] [-p priority] [-z num_threads]

Runs on:

QNX OS

Options:

-b
Use batch mode for background operation. This is useful if you want to redirect the output from top to another process; in batch mode, top doesn't accept input, and so it runs for the number of iterations specified with the -i option or until you kill it.
-D delay
Set the delay, in seconds, for refreshing the display. The default is 5; the minimum is 1, and the maximum is 5000.
-d
Tailor the output for a dumb terminal. By default, top refreshes its output in place for each iteration. If you specify -d, top displays the output for each iteration after the output from the previous one.
-i number
Run for the specified number of iterations. By default, top runs until you terminate it.
-p priority
Run at the specified priority.
-t
Display the thread names.
-z num_threads
Specify the number of threads to display. The default is 10; the minimum is 5, and the maximum is 100.

Description:

The top utility runs in a loop, displaying the system usage, waiting for a while, and then refreshing the display. Its output looks like this:
3 online CPUs; 18 processes; 122 threads;
CPU states: 75.1% user, 0.8% kernel
Memory: 1024M total, 867M avail, page size 4K

   PID     TID    PRI   STATE    HH:MM:SS     CPU    COMMAND
499714       2    254   Run      00:10:03   24.99%   offline
499714       4     10   Run      00:09:53   24.54%   process-tmp
499714       3     10   Run      00:09:53   24.53%   process-foo
266258       8     21   Rcv      00:00:05    0.52%   io-usb-otg
     1      10    253   Intr     00:00:06    0.32%   kernel
     1      11    253   Intr     00:00:06    0.30%   kernel
     1      26     10   Run      00:00:01    0.15%   kernel
143372      21     21   CdV      00:00:04    0.12%   io-sock
143372      15     21   Rcv      00:00:02    0.12%   io-sock
143372      36     21   Sem      00:00:02    0.10%   io-sock

Idle:        Curr       Min       Max        Avg
CPU  0:      OFFL         0%        0%         0%
CPU  1:      37.3%       21%       97%        37%
CPU  2:      39.1%       28%       97%        43%
CPU  3:      95.5%       94%       96%        95%
Mem Avail:              867M      867M       867M
Processes:               18        18         18
Threads:                122       122        122
The utility supports the following interactive commands:
? or h
Display help information.
d
Modify the delay between updates. The default is 5 seconds.
k
Kill a process; top prompts you for the process ID.
l
Refresh the screen.
n
Modify the number of threads to display. The default is 10; the minimum is 5.
q
Quit.
Note:
For a more comprehensive method of determining how much memory a process uses, go to Calculating virtual memory reserved by a process in the Process Manager chapter of the System Architecture guide.
Page updated: