1 .\" Copyright (c) 1986, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 4. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)vmstat.8 8.1 (Berkeley) 6/6/93
36 .Nd report virtual memory statistics
41 .Op Fl M Ar core Op Fl N Ar system
56 utility reports certain kernel statistics kept about process, virtual memory,
57 disk, trap and cpu activity.
61 option is not specified, information is obtained from
62 the currently running kernel via the
65 Otherwise, information is read from the specified core file,
66 using the name list from the specified kernel image (or from
69 The options are as follows:
70 .Bl -tag -width indent
74 include statistics about interrupts that have never been generated.
79 The first display is for the time since a reboot and each subsequent
80 report is for the time period since the last display.
85 is specified, the default is infinity, otherwise the default is one.
92 system calls since system startup, and the number of pages of virtual memory
95 Changes memory columns into more easily human readable form.
97 standard output is a terminal device.
99 Changes memory columns into straight numbers.
100 The default if standard output
101 is not a terminal device (such as a script).
103 Report on the number of interrupts taken by each device since system
106 Extract values associated with the name list from the specified
112 extract the name list from the specified
114 instead of the default,
115 which is the kernel image the system has booted from.
117 Report on the usage of kernel dynamic memory allocated using
121 Change the maximum number of disks to display from the default of 2.
123 Report per-cpu system/user/idle cpu statistics.
125 Specify which types of devices to display.
126 There are three different
127 categories of devices:
129 .Bl -tag -width indent -compact
131 .Bl -tag -width 9n -compact
133 Direct Access devices
135 Sequential Access devices
141 Write Once Read Multiple devices
147 Optical Memory devices
149 Medium Changer devices
151 Communication devices
153 Storage Array devices
155 Enclosure Services devices
161 .Bl -tag -width 9n -compact
163 Integrated Drive Electronics devices
165 Small Computer System Interface devices
167 Any other device interface
171 .Bl -tag -width 9n -compact
177 The user must specify at least one device type, and may specify at most
178 one device type from each category.
179 Multiple device types in a single
180 device type statement must be separated by commas.
184 arguments may be specified on the command line.
187 arguments are ORed together to form a matching expression against which
188 all devices in the system are compared.
189 Any device that fully matches
192 argument will be included in the
194 output, up to two devices, or the maximum number of devices specified
197 Display the contents of the
199 structure, giving the total number of several kinds of paging related
200 events which have occurred since system startup.
202 .\" Report on the number of page in and page reclaims since system startup,
203 .\" and the amount of time required by each.
207 seconds between each display.
210 interval is specified, the default is 1 second.
213 command will accept and honor a non-integer number of seconds.
215 Report on memory used by the kernel zone allocator,
224 arguments may be given after their respective flags at any point
225 on the command line before the
227 argument(s), or without their flags, as the final argument(s).
228 The latter form is accepted for backwards compatibility, but it is
229 preferred to use the forms with
237 displays the following information:
238 .Bl -tag -width indent
240 Information about the numbers of processes in various states.
242 .Bl -tag -width indent -compact
246 blocked for resources (i/o, paging, etc.)
248 runnable or short sleeper (< 20 secs) but swapped
251 Information about the usage of virtual and real memory.
252 Virtual pages (reported in units of 1024 bytes) are considered active if
253 they belong to processes which are running or have run in the last 20
256 .Bl -tag -width indent -compact
260 size of the free list
263 Information about page faults and paging activity.
264 These are averaged each five seconds, and given in units per second.
266 .Bl -tag -width indent -compact
268 total number of page faults
270 page reclaims (simulating reference bits)
272 .\" pages attached (found in free list)
278 pages freed per second
280 .\" anticipated short term memory shortfall
282 pages scanned by clock algorithm, per-second
285 Disk operations per second (this field is system dependent).
286 Typically paging will be split across the available drives.
287 The header of the field is the first two characters of the disk name and
289 If more than two disk drives are configured in the system,
291 displays only the first two drives, unless the user specifies the
293 argument to increase the number of drives displayed.
295 cause the display to exceed 80 columns, however.
298 to display specific drives, their names may be supplied on the command line.
302 defaults to show disks first, and then various other random devices in the
303 system to add up to two devices, if there are that many devices in the
305 If devices are specified on the command line, or if a device type
306 matching pattern is specified (see above),
308 will only display the given devices or the devices matching the pattern,
309 and will not randomly select other devices in the system.
311 Trap/interrupt rate averages per second over last 5 seconds.
313 .Bl -tag -width indent -compact
315 device interrupts per interval (including clock interrupts)
317 system calls per interval
319 cpu context switch rate (switches/interval)
322 Breakdown of percentage usage of CPU time.
324 .Bl -tag -width indent -compact
326 user time for normal and low priority processes
334 .Bl -tag -width /boot/kernel/kernel -compact
335 .It Pa /boot/kernel/kernel
336 default kernel namelist
343 will print what the system is doing every five
344 seconds; this is a good choice of printing interval since this is how often
345 some of the statistics are sampled in the system.
346 Others vary every second and running the output for a while will make it
347 apparent which are recomputed every second.
350 .Dl vmstat -p da -p cd -w 1
351 will tell vmstat to select the first two direct access or CDROM devices
352 and display statistics on those devices, as well as other systems
353 statistics every second.
368 The sections starting with ``Interpreting system activity'' in
369 .%T "Installing and Operating 4.3BSD" .
375 options are only available with the default output.