]> git.saurik.com Git - apple/system_cmds.git/blame - top.tproj/top.1
system_cmds-175.tar.gz
[apple/system_cmds.git] / top.tproj / top.1
CommitLineData
1815bff5
A
1.\" Copyright (c) 1999, Apple Computer, Inc. All rights reserved.
2.\"
3.Dd September 30, 1999
4.Dt TOP 1
5.Os "Mac OS X"
6.Sh NAME
7.Nm top
8.Nd show system usage statistics
9.Sh SYNOPSIS
10.Nm top
11.Op Fl u
12.Op Fl w
13.Op Fl k
14.Op Fl s Ar interval
15.Op Fl e | Fl d | Fl a
16.Op Fl l Ar samples
17.Op Ar number
18.Sh DESCRIPTION
19.Nm top
20displays an ongoing sample of system usage statistics. It operates
21in various modes, but by default shows cpu utilization and
22memory usage for each process in the system.
23.Pp
24The options are as follows:
25.Bl -tag -width Ds
26.It Fl u
27When the
28.Fl u
29option is specified, processes are first sorted by cpu usage
30and then displayed starting with the highest consumers.
31.It Fl w
32Specifying the
33.Fl w
34option generates additional columns in the output producing
35a much wider display of data. The additional columns include
36VPRVT, along with the delta information for #PRTS,
37RPRVT, RSHRD, RSIZE and VSIZE (see descriptions following).
38.It Fl k
39The
40.Fl k
41option causes
42.Nm top
43to traverse and report the memory object map for pid 0
44(the kernel task). It is optional because it is fairly
45expensive to traverse the object maps and the kernel
46task may have a huge number of entries.
47.It Fl s
48By default,
49.Nm top
50updates its output at one second intervals. This sampling
51interval may be changed by specifying the
52.Fl s
53option. Enter the
54.Ar interval
55in seconds.
56.It Fl e
57Using the
58.Fl e
59option switches from the default output to an event counting
60mode where the counts reported are absolute counters. The
61.Fl w
62and
63.Fl k
64options are ignored when running in event counting mode.
65.It Fl d
66Using the
67.Fl d
68option switches from the default output to an event counting
69mode where the counts are reported as deltas relative to
70the previous sample.
71The
72.Fl w
73and
74.Fl k
75options are ignored when running in event counting, delta mode.
76.It Fl a
77Using the
78.Fl a
79option switches from the default output to an event counting
80mode where the counts are reported as cumulative counters relative to
81when top was launched.
82The
83.Fl w
84and
85.Fl k
86options are ignored when running in event counting, accumulate mode.
87.It Fl l
88Using the
89.Fl l
90option switches from the default screen mode to a logging mode suitable for
91saving the output to a file. You may specify the number of samples to be
92output before top exits, the default is 1 sample.
93.It number
94If you wish to limit the number of processes displayed by
95.Nm top,
96specify the desired
97.Ar number
98of output lines in this last argument.
99.El
100.Pp
101The columns displayed in the default data mode are as follows:
102.Bl -tag -width VSIZE(deltadelta) -compact
103.Pp
104.It PID
105the Unix process id.
106.It COMMAND
107the Unix command name.
108.It %CPU
109the percentage of cpu consumed (kernel and user).
110.It TIME
111the absolute cpu consumption (min:secs.hundreths).
112.It #TH
113the number of threads.
114.It #PRTS(delta)
115the number of mach ports.
116.It #MREG
117the number of memory regions.
118.It VPRVT(-w only)
119the private address space currently allocated.
120.It RPRVT(delta)
121the resident private memory.
122.It RSHRD(delta)
123the resident shared memory (as represented by the
124resident page count of each shared memory object).
125.It RSIZE(delta)
126the total resident memory (real pages that this
127process currently has associated with it. Some
128may be shared by other processes).
129.It VSIZE(delta)
130the total address space currently allocated (including shared).
131.El
132.Pp
133The delta columns are enabled by the
134.Fl w
135option. The deltas for #PRTS and VSIZE are relative
136to the numbers observed when
137.Nm top
138was launched. The deltas for RPRVT, RSHRD and RSIZE are relative to
139the previous sample. If the
140.Fl w
141option was not specified,
142.Nm top
143will append either a '+' or a '-' to the RPRVT, RSHRD, RSIZE or VSIZE
144columns indicating either a gain or a loss relative to the previous sample.
145.Pp
146The columns displayed in the event counting modes (ie: -e | -d | -a options)
147are as follows:
148.Bl -tag -width MACHSYSCALL -compact
149.Pp
150.It PID
151the Unix process id.
152.It COMMAND
153the Unix command name.
154.It %CPU
155the percentage of cpu consumed (kernel and user).
156.It TIME
157the absolute cpu consumption (min:secs.hundreths).
158.It FAULTS
159the number of page faults.
160.It PAGEINS
161the number of requests for pages from a pager.
162.It COW_FAULTS
163the number of faults that caused a page to be copied.
164.It MSGS_SENT
165the number of mach messages sent by the process.
166.It MSGS_RCVD
167the number of mach messages received by the process.
168.It BSDSYSCALL
169the number of BSD system calls made by the process.
170.It MACHSYSCALL
171the number of MACH system calls made by the process.
172.It CSWITCH
173the number of context switches to this process.
174.El
175.Pp
176The
177.Nm top
178command also displays some global state in the first few lines of output,
179including load averages, cpu utilization and idleness, process and thread counts and memory breakdowns
180for shared libraries and processes.
181The
182.Nm top
183command is SIGWINCH savvy, so adjusting your window geometry may change
184the number of processes and number of columns displayed. Typing a 'q' will cause top to exit
185immediately. Typing any other character will cause top to immediately update it's display.
186.Sh SAMPLE USAGE
187.Pp
188top -u -s5 20
189.Pp
190.Nm top
191will sort the processes according to cpu usage, update the output at 5
192second intervals, and limit the display to the top 20 processes.
193.Sh SEE ALSO
194.Xr vm_stat 1