xref: /netbsd-src/usr.bin/vmstat/vmstat.1 (revision 7fa608457b817eca6e0977b37f758ae064f3c99c)
1.\"	$NetBSD: vmstat.1,v 1.17 2007/11/07 00:24:18 ad Exp $
2.\"
3.\" Copyright (c) 2000, 2007 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by the NetBSD
17.\"	Foundation, Inc. and its contributors.
18.\" 4. Neither the name of The NetBSD Foundation nor the names of its
19.\"    contributors may be used to endorse or promote products derived
20.\"    from this software without specific prior written permission.
21.\"
22.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
23.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
24.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
26.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32.\" POSSIBILITY OF SUCH DAMAGE.
33.\"
34.\" Copyright (c) 1986, 1993
35.\"	The Regents of the University of California.  All rights reserved.
36.\"
37.\" Redistribution and use in source and binary forms, with or without
38.\" modification, are permitted provided that the following conditions
39.\" are met:
40.\" 1. Redistributions of source code must retain the above copyright
41.\"    notice, this list of conditions and the following disclaimer.
42.\" 2. Redistributions in binary form must reproduce the above copyright
43.\"    notice, this list of conditions and the following disclaimer in the
44.\"    documentation and/or other materials provided with the distribution.
45.\" 3. Neither the name of the University nor the names of its contributors
46.\"    may be used to endorse or promote products derived from this software
47.\"    without specific prior written permission.
48.\"
49.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
50.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
51.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
52.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
53.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
54.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
55.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
56.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
57.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
58.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
59.\" SUCH DAMAGE.
60.\"
61.\"	@(#)vmstat.8	8.1 (Berkeley) 6/6/93
62.\"
63.Dd November 6, 2007
64.Dt VMSTAT 1
65.Os
66.Sh NAME
67.Nm vmstat
68.Nd report virtual memory statistics
69.Sh SYNOPSIS
70.Nm
71.Op Fl CefHiLlmstUvW
72.Op Fl c Ar count
73.Op Fl h Ar hashname
74.Op Fl M Ar core
75.Op Fl N Ar system
76.Op Fl u Ar histname
77.Op Fl w Ar wait
78.Op Ar disks
79.Sh DESCRIPTION
80.Nm
81reports certain kernel statistics kept about process, virtual memory,
82disk, trap, and CPU activity.
83.Pp
84The options are as follows:
85.Bl -tag -width xxxhistname
86.It Fl C
87Report on kernel memory caches.
88Combine with the
89.Fl m
90option to see information about memory pools that back the caches.
91.It Fl c Ar count
92Repeat the display
93.Ar count
94times.
95The first display is for the time since a reboot and each subsequent report
96is for the time period since the last display.
97If no
98.Ar wait
99interval is specified, the default is 1 second.
100.It Fl e
101Report the values of system event counters.
102.It Fl f
103Report fork statistics.
104.It Fl H
105Report all hash table statistics.
106.It Fl h Ar hashname
107Report hash table statistics for
108.Ar hashname .
109.It Fl i
110Report the values of system interrupt counters.
111.It Fl L
112List all the hashes supported for
113.Fl h
114and
115.Fl H .
116.It Fl l
117List the UVM histories being maintained by the kernel.
118.It Fl M Ar core
119Extract values associated with the name list from the specified core
120instead of the default
121.Pa /dev/mem .
122.It Fl m
123Report on the usage of kernel dynamic memory listed first by size of
124allocation and then by type of usage,
125followed by a list of the kernel memory pools and their usage.
126.It Fl N Ar system
127Extract the name list from the specified system instead of the default
128.Pa /netbsd .
129.It Fl s
130Display the contents of the
131.Dv uvmexp
132structure.
133This contains various paging event and memory status counters.
134.It Fl t
135Display the contents of the
136.Dv vmtotal
137structure.
138This includes information about processes and virtual memory.
139.Pp
140The process part shows the number of processes in the following states:
141.Pp
142.Bl -tag -width abc -compact
143.It ru
144on the run queue
145.It dw
146in disk I/O wait
147.It pw
148waiting for paging
149.It sl
150sleeping while resident
151.It sw
152swapped out, but either runnable or in short-term blocking state
153.El
154.Pp
155The virtual memory section shows:
156.Pp
157.Bl -tag -width abcdefgh -compact
158.It total-v
159Total virtual memory
160.It active-v
161Active virtual memory in use
162.It active-r
163Active real memory in use
164.It vm-sh
165Shared virtual memory
166.It avm-sh
167Active shared virtual memory
168.It rm-sh
169Shared real memory
170.It arm-sh
171Active shared real memory
172.It free
173Free memory
174.El
175.Pp
176All memory values are shown in number of pages.
177.It Fl U
178Dump all UVM histories.
179.It Fl u Ar histname
180Dump the specified UVM history.
181.It Fl v
182Print more verbose information.
183When used with the
184.Fl i ,
185.Fl e ,
186or
187.Fl m
188options prints out all counters, not just those with non-zero values.
189.It Fl W
190Print more verbose information about kernel memory pools.
191.It Fl w Ar wait
192Pause
193.Ar wait
194seconds between each display.
195If no repeat
196.Ar count
197is specified, the default is infinity.
198.El
199.Pp
200By default,
201.Nm
202displays the following information:
203.Pp
204.Bl -tag -width memory
205.It procs
206Information about the numbers of processes in various states.
207.Pp
208.Bl -tag -width abcd -compact
209.It r
210in run queue
211.It b
212blocked for resources (i/o, paging, etc.)
213.It w
214runnable or short sleeper (\*[Lt] 20 secs) but swapped
215.El
216.It memory
217Information about the usage of virtual and real memory.
218Virtual pages (reported in units of 1024 bytes) are considered active if
219they belong to processes which are running or have run in the last 20
220seconds.
221.Pp
222.Bl -tag -width abcd -compact
223.It avm
224active virtual pages
225.It fre
226size of the free list
227.El
228.It page
229Information about page faults and paging activity.
230These are averaged every five seconds, and given in units per second.
231.Pp
232.Bl -tag -width abcd -compact
233.It flt
234total page faults
235.It re
236page reclaims (simulating reference bits)
237.It pi
238pages paged in
239.It po
240pages paged out
241.It fr
242pages freed per second
243.It sr
244pages scanned by clock algorithm, per-second
245.El
246.It disks
247Disk transfers per second.
248Typically paging will be split across the available drives.
249The header of the field is the first character of the disk name and
250the unit number.
251If more than four disk drives are configured in the system,
252.Nm
253displays only the first four drives.
254To force
255.Nm
256to display specific drives, their names may be supplied on the command line.
257.It faults
258Trap/interrupt rate averages per second over last 5 seconds.
259.Pp
260.Bl -tag -width abcd -compact
261.It in
262device interrupts per interval (including clock interrupts)
263.It sy
264system calls per interval
265.It cs
266CPU context switch rate (switches/interval)
267.El
268.It cpu
269Breakdown of percentage usage of CPU time.
270.Pp
271.Bl -tag -width abcd -compact
272.It us
273user time for normal and low priority processes
274.It sy
275system time
276.It id
277CPU idle
278.El
279.El
280.Sh FILES
281.Bl -tag -width eeenymeeny -compact
282.It Pa /netbsd
283default kernel namelist
284.It Pa /dev/mem
285default memory file
286.El
287.Sh EXAMPLES
288The command
289.Dq Li vmstat -w 5
290will print what the system is doing every five
291seconds; this is a good choice of printing interval since this is how often
292some of the statistics are sampled in the system.
293Others vary every second and running the output for a while will make it
294apparent which are recomputed every second.
295.Sh SEE ALSO
296.Xr fstat 1 ,
297.Xr netstat 1 ,
298.Xr nfsstat 1 ,
299.Xr ps 1 ,
300.Xr systat 1 ,
301.Xr iostat 8 ,
302.Xr pstat 8
303.Pp
304The sections starting with
305.Dq Interpreting system activity
306in
307.%T Installing and Operating 4.3BSD .
308.Sh BUGS
309The
310.Fl c
311and
312.Fl w
313options are only available with the default output.
314.Pp
315The
316.Fl l ,
317.Fl U ,
318and
319.Fl u
320options are useful only if the system was compiled with support for UVM
321history.
322