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