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.\" 34.Dd June 6, 1996 35.Dt VMSTAT 8 36.Os BSD 4 37.Sh NAME 38.Nm vmstat 39.Nd report virtual memory statistics 40.Sh SYNOPSIS 41.Nm vmstat 42.Op Fl fimst 43.Op Fl c Ar count 44.Op Fl M core 45.Op Fl N system 46.Op Fl w wait 47.Op Ar disks 48.Sh DESCRIPTION 49.Nm Vmstat 50reports certain kernel statistics kept about process, virtual memory, 51disk, trap and cpu activity. 52.Pp 53The options are as follows: 54.Bl -tag -width indent 55.It Fl c 56Repeat the display 57.Ar count 58times. 59The first display is for the time since a reboot and each subsequent report 60is for the time period since the last display. 61If no 62.Ar wait 63interval is specified, the default is 1 second. 64.It Fl f 65Report on the number 66.Xr fork 2 67and 68.Xr vfork 2 69system calls since system startup, and the number of pages of virtual memory 70involved in each. 71.It Fl i 72Report on the number of interrupts taken by each device since system 73startup. 74.It Fl M 75Extract values associated with the name list from the specified 76.Ar core 77instead of the default 78.Pa /dev/kmem . 79.It Fl N 80Extract the name list from the specified 81.Ar system 82instead of the default 83.Pa /kernel . 84.It Fl m 85Report on the usage of kernel dynamic memory listed first by size of 86allocation and then by type of usage. 87.It Fl s 88Display the contents of the 89.Em sum 90structure, giving the total number of several kinds of paging related 91events which have occurred since system startup. 92.It Fl t 93Report on the number of page in and page reclaims since system startup, 94and the amount of time required by each. 95.It Fl w 96Pause 97.Ar wait 98seconds between each display. 99If no repeat 100.Ar count 101is specified, the default is infinity. 102.El 103.Pp 104By default, 105.Nm vmstat 106displays the following information: 107.Pp 108.Bl -tag -width indent 109.It procs 110Information about the numbers of processes in various states. 111.Pp 112.Bl -tag -width indent -compact 113.It r 114in run queue 115.It b 116blocked for resources (i/o, paging, etc.) 117.It w 118runnable or short sleeper (< 20 secs) but swapped 119.El 120.It memory 121Information about the usage of virtual and real memory. 122Virtual pages (reported in units of 1024 bytes) are considered active if 123they belong to processes which are running or have run in the last 20 124seconds. 125.Pp 126.Bl -tag -width indent -compact 127.It avm 128active virtual pages 129.It fre 130size of the free list 131.El 132.It page 133Information about page faults and paging activity. 134These are averaged each five seconds, and given in units per second. 135.Pp 136.Bl -tag -width indent -compact 137.It re 138page reclaims (simulating reference bits) 139.It at 140pages attached (found in free list) 141.It pi 142pages paged in 143.It po 144pages paged out 145.It fr 146pages freed per second 147.It de 148anticipated short term memory shortfall 149.It sr 150pages scanned by clock algorithm, per-second 151.El 152.It disks 153Disk operations per second (this field is system dependent). 154Typically paging will be split across the available drives. 155The header of the field is the first character of the disk name and 156the unit number. 157If more than four disk drives are configured in the system, 158.Nm vmstat 159displays only the first four drives. 160To force 161.Nm vmstat 162to display specific drives, their names may be supplied on the command line. 163.It faults 164Trap/interrupt rate averages per second over last 5 seconds. 165.Pp 166.Bl -tag -width indent -compact 167.It in 168device interrupts per interval (including clock interrupts) 169.It sy 170system calls per interval 171.It cs 172cpu context switch rate (switches/interval) 173.El 174.It cpu 175Breakdown of percentage usage of CPU time. 176.Pp 177.Bl -tag -width indent -compact 178.It us 179user time for normal and low priority processes 180.It sy 181system time 182.It id 183cpu idle 184.El 185.El 186.Sh EXAMPLES 187The command: 188.Dl vmstat -w 5 189will print what the system is doing every five 190seconds; this is a good choice of printing interval since this is how often 191some of the statistics are sampled in the system. 192Others vary every second and running the output for a while will make it 193apparent which are recomputed every second. 194.Sh FILES 195.Bl -tag -width /dev/kmemxxx -compact 196.It Pa /kernel 197default kernel namelist 198.It Pa /dev/kmem 199default memory file 200.El 201.Sh SEE ALSO 202.Xr fstat 1 , 203.Xr netstat 1 , 204.Xr nfsstat 1 , 205.Xr ps 1 , 206.Xr systat 1 , 207.Xr iostat 8 , 208.Xr pstat 8 209.Pp 210The sections starting with ``Interpreting system activity'' in 211.%T "Installing and Operating 4.3BSD" . 212.SH BUGS 213The 214.Fl c 215and 216.Fl w 217options are only available with the default output. 218