1.\" $NetBSD: vmstat.1,v 1.20 2009/10/21 22:18:37 wiz 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 October 22, 2009 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 144.El 145.Pp 146The virtual memory section shows: 147.Pp 148.Bl -tag -width abcdefgh -compact 149.It total-v 150Total virtual memory 151.It active-v 152Active virtual memory in use 153.It active-r 154Active real memory in use 155.It vm-sh 156Shared virtual memory 157.It avm-sh 158Active shared virtual memory 159.It rm-sh 160Shared real memory 161.It arm-sh 162Active shared real memory 163.It free 164Free memory 165.El 166.Pp 167All memory values are shown in number of pages. 168.It Fl U 169Dump all UVM histories. 170.It Fl u Ar histname 171Dump the specified UVM history. 172.It Fl v 173Print more verbose information. 174When used with the 175.Fl i , 176.Fl e , 177or 178.Fl m 179options prints out all counters, not just those with non-zero values. 180.It Fl W 181Print more verbose information about kernel memory pools. 182.It Fl w Ar wait 183Pause 184.Ar wait 185seconds between each display. 186If no repeat 187.Ar count 188is specified, the default is infinity. 189.El 190.Pp 191By default, 192.Nm 193displays the following information: 194.Pp 195.Bl -tag -width memory 196.It procs 197Information about the numbers of processes in various states. 198.Pp 199.Bl -tag -width abcd -compact 200.It r 201in run queue 202.It b 203blocked for resources (i/o, paging, etc.) 204.El 205.It memory 206Information about the usage of virtual and real memory. 207Virtual pages (reported in units of 1024 bytes) are considered active if 208they belong to processes which are running or have run in the last 20 209seconds. 210.Pp 211.Bl -tag -width abcd -compact 212.It avm 213active virtual pages 214.It fre 215size of the free list 216.El 217.It page 218Information about page faults and paging activity. 219These are averaged every five seconds, and given in units per second. 220.Pp 221.Bl -tag -width abcd -compact 222.It flt 223total page faults 224.It re 225page reclaims (simulating reference bits) 226.It pi 227pages paged in 228.It po 229pages paged out 230.It fr 231pages freed per second 232.It sr 233pages scanned by clock algorithm, per-second 234.El 235.It disks 236Disk transfers per second. 237Typically paging will be split across the available drives. 238The header of the field is the first character of the disk name and 239the unit number. 240If more than four disk drives are configured in the system, 241.Nm 242displays only the first four drives. 243To force 244.Nm 245to display specific drives, their names may be supplied on the command line. 246.It faults 247Trap/interrupt rate averages per second over last 5 seconds. 248.Pp 249.Bl -tag -width abcd -compact 250.It in 251device interrupts per interval (including clock interrupts) 252.It sy 253system calls per interval 254.It cs 255CPU context switch rate (switches/interval) 256.El 257.It cpu 258Breakdown of percentage usage of CPU time. 259.Pp 260.Bl -tag -width abcd -compact 261.It us 262user time for normal and low priority processes 263.It sy 264system time 265.It id 266CPU idle 267.El 268.El 269.Sh FILES 270.Bl -tag -width eeenymeeny -compact 271.It Pa /netbsd 272default kernel namelist 273.It Pa /dev/mem 274default memory file 275.El 276.Sh EXAMPLES 277The command 278.Dq Li vmstat -w 5 279will print what the system is doing every five 280seconds; this is a good choice of printing interval since this is how often 281some of the statistics are sampled in the system. 282Others vary every second and running the output for a while will make it 283apparent which are recomputed every second. 284.Sh SEE ALSO 285.Xr fstat 1 , 286.Xr netstat 1 , 287.Xr nfsstat 1 , 288.Xr ps 1 , 289.Xr systat 1 , 290.Xr iostat 8 , 291.Xr pstat 8 292.Pp 293The sections starting with 294.Dq Interpreting system activity 295in 296.%T Installing and Operating 4.3BSD . 297.Sh BUGS 298The 299.Fl c 300and 301.Fl w 302options are only available with the default output. 303.Pp 304The 305.Fl l , 306.Fl U , 307and 308.Fl u 309options are useful only if the system was compiled with support for UVM 310history. 311