1.\" Copyright (c) 1986, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 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.\" 3. All advertising materials mentioning features or use of this software 13.\" must display the following acknowledgement: 14.\" This product includes software developed by the University of 15.\" California, Berkeley and its contributors. 16.\" 4. Neither the name of the University nor the names of its contributors 17.\" may be used to endorse or promote products derived from this software 18.\" without specific prior written permission. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" SUCH DAMAGE. 31.\" 32.\" @(#)vmstat.8 8.1 (Berkeley) 6/6/93 33.\" $FreeBSD$ 34.\" 35.Dd June 6, 1996 36.Dt VMSTAT 8 37.Os BSD 4 38.Sh NAME 39.Nm vmstat 40.Nd report virtual memory statistics 41.Sh SYNOPSIS 42.Nm vmstat 43.\" .Op Fl fimst 44.Op Fl imsz 45.Op Fl c Ar count 46.Op Fl M Ar core 47.Op Fl N Ar system 48.Op Fl w Ar wait 49.Op Fl n Ar devs 50.Op Fl p Ar type,if,pass 51.Op Ar disks 52.Sh DESCRIPTION 53.Nm Vmstat 54reports certain kernel statistics kept about process, virtual memory, 55disk, trap and cpu activity. 56.Pp 57The options are as follows: 58.Bl -tag -width indent 59.It Fl c 60Repeat the display 61.Ar count 62times. 63The first display is for the time since a reboot and each subsequent 64report is for the time period since the last display. 65If no repeat 66.Ar count 67is specified, and 68.Fl w 69is specified, the default is infinity, otherwise the default is one. 70.\" .It Fl f 71.\" Report on the number 72.\" .Xr fork 2 73.\" and 74.\" .Xr vfork 2 75.\" system calls since system startup, and the number of pages of virtual memory 76.\" involved in each. 77.It Fl i 78Report on the number of interrupts taken by each device since system 79startup. 80.It Fl M 81Extract values associated with the name list from the specified 82.Ar core 83instead of the default 84.Pa /dev/kmem . 85.It Fl N 86Extract the name list from the specified 87.Ar system 88instead of the default 89.Pa /kernel . 90.It Fl m 91Report on the usage of kernel dynamic memory listed first by size of 92allocation and then by type of usage. 93.It Fl n 94Change the maximum number of disks to display from the default of 2. 95.It Fl p 96Specify which types of devices to display. There are three different 97categories of devices: 98 99.Bl -tag -width indent -compact 100.It device type: 101.Bl -tag -width 123456789 -compact 102.It da 103Direct Access devices 104.It sa 105Sequential Access devices 106.It printer 107Printers 108.It proc 109Processor devices 110.It worm 111Write Once Read Multiple devices 112.It cd 113CD devices 114.It scanner 115Scanner devices 116.It optical 117Optical Memory devices 118.It changer 119Medium Changer devices 120.It comm 121Communication devices 122.It array 123Storage Array devices 124.It enclosure 125Enclosure Services devices 126.It floppy 127Floppy devices 128.El 129.Pp 130.It interface: 131.Bl -tag -width 123456789 -compact 132.It IDE 133Integrated Drive Electronics devices 134.It SCSI 135Small Computer System Interface devices 136.It other 137Any other device interface 138.El 139.Pp 140.It passthrough: 141.Bl -tag -width 123456789 -compact 142.It pass 143Passthrough devices 144.El 145.El 146.Pp 147The user must specify at least one device type, and may specify at most 148one device type from each category. Multiple device types in a single 149device type statement must be separated by commas. 150.Pp 151Any number of 152.Fl p 153arguments may be specified on the command line. All 154.Fl p 155arguments are ORed together to form a matching expression against which 156all devices in the system are compared. Any device that fully matches 157any 158.Fl p 159argument will be included in the 160.Nm 161output, up to three devices, or the maximum number of devices specified 162by the user. 163.It Fl s 164Display the contents of the 165.Em sum 166structure, giving the total number of several kinds of paging related 167events which have occurred since system startup. 168.\" .It Fl t 169.\" Report on the number of page in and page reclaims since system startup, 170.\" and the amount of time required by each. 171.It Fl w 172Pause 173.Ar wait 174seconds between each display. 175If no repeat 176.Ar wait 177interval is specified, the default is 1 second. 178.It Fl z 179Report on memory used by the kernel zone allocator, by zone. 180.El 181.Pp 182By default, 183.Nm 184displays the following information: 185.Pp 186.Bl -tag -width indent 187.It procs 188Information about the numbers of processes in various states. 189.Pp 190.Bl -tag -width indent -compact 191.It r 192in run queue 193.It b 194blocked for resources (i/o, paging, etc.) 195.It w 196runnable or short sleeper (< 20 secs) but swapped 197.El 198.It memory 199Information about the usage of virtual and real memory. 200Virtual pages (reported in units of 1024 bytes) are considered active if 201they belong to processes which are running or have run in the last 20 202seconds. 203.Pp 204.Bl -tag -width indent -compact 205.It avm 206active virtual pages 207.It fre 208size of the free list 209.El 210.It page 211Information about page faults and paging activity. 212These are averaged each five seconds, and given in units per second. 213.Pp 214.Bl -tag -width indent -compact 215.It flt 216total number of page faults 217.It re 218page reclaims (simulating reference bits) 219.\" .It at 220.\" pages attached (found in free list) 221.It pi 222pages paged in 223.It po 224pages paged out 225.It fr 226pages freed per second 227.\" .It de 228.\" anticipated short term memory shortfall 229.It sr 230pages scanned by clock algorithm, per-second 231.El 232.It disks 233Disk operations per second (this field is system dependent). 234Typically paging will be split across the available drives. 235The header of the field is the first two characters of the disk name and 236the unit number. 237If more than three disk drives are configured in the system, 238.Nm 239displays only the first three drives, unless the user specifies the 240.Fl n 241argument to increase the number of drives displayed. This will probably 242cause the display to exceed 80 columns, however. 243To force 244.Nm 245to display specific drives, their names may be supplied on the command line. 246.Nm 247defaults to show disks first, and then various other random devices in the 248system to add up to three devices, if there are that many devices in the 249system. If devices are specified on the command line, or if a device type 250matching pattern is specified (see above), 251.Nm 252will only display the given devices or the devices matching the pattern, 253and will not randomly select other devices in the system. 254.It faults 255Trap/interrupt rate averages per second over last 5 seconds. 256.Pp 257.Bl -tag -width indent -compact 258.It in 259device interrupts per interval (including clock interrupts) 260.It sy 261system calls per interval 262.It cs 263cpu context switch rate (switches/interval) 264.El 265.It cpu 266Breakdown of percentage usage of CPU time. 267.Pp 268.Bl -tag -width indent -compact 269.It us 270user time for normal and low priority processes 271.It sy 272system time 273.It id 274cpu idle 275.El 276.El 277.Sh EXAMPLES 278The command: 279.Dl vmstat -w 5 280will print what the system is doing every five 281seconds; this is a good choice of printing interval since this is how often 282some of the statistics are sampled in the system. 283Others vary every second and running the output for a while will make it 284apparent which are recomputed every second. 285.Pp 286The command: 287.Dl vmstat -p da -p cd -w 1 288will tell vmstat to select the first three direct access or CDROM devices 289and display statistics on those devices, as well as other systems 290statistics every second. 291.Sh FILES 292.Bl -tag -width /dev/kmemxxx -compact 293.It Pa /kernel 294default kernel namelist 295.It Pa /dev/kmem 296default memory file 297.El 298.Sh SEE ALSO 299.Xr fstat 1 , 300.Xr netstat 1 , 301.Xr nfsstat 1 , 302.Xr ps 1 , 303.Xr systat 1 , 304.Xr iostat 8 , 305.Xr pstat 8 306.Pp 307The sections starting with ``Interpreting system activity'' in 308.%T "Installing and Operating 4.3BSD" . 309.Sh BUGS 310The 311.Fl c 312and 313.Fl w 314options are only available with the default output. 315