1.\" $NetBSD: vmstat.1,v 1.24 2018/12/25 03:38:59 sevan 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 December 25, 2018 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. 76If 77.Nm 78is invoked without any options, it displays the summary of statistics since 79boot and exits. 80This is also referred to as the first line of 81.Nm . 82.Pp 83The options are as follows: 84.Bl -tag -width xxxhistname 85.It Fl C 86Report on kernel memory caches. 87Combine with the 88.Fl m 89option to see information about memory pools that back the caches. 90.It Fl c Ar count 91Repeat the display 92.Ar count 93times. 94The first display is for the time since a reboot and each subsequent report 95is for the time period since the last display. 96If no 97.Ar wait 98interval is specified, the default is 1 second. 99.It Fl e 100Report the values of system event counters. 101.It Fl f 102Report fork statistics. 103.It Fl H 104Report all hash table statistics. 105.It Fl h Ar hashname 106Report hash table statistics for 107.Ar hashname . 108.It Fl i 109Report the values of system interrupt counters. 110.It Fl L 111List all the hashes supported for 112.Fl h 113and 114.Fl H . 115.It Fl l 116List the UVM histories being maintained by the kernel. 117.It Fl M Ar core 118Extract values associated with the name list from the specified core 119instead of the default 120.Pa /dev/mem . 121.It Fl m 122Report on the usage of kernel dynamic memory listed first by size of 123allocation and then by type of usage, 124followed by a list of the kernel memory pools and their usage. 125.It Fl N Ar system 126Extract the name list from the specified system instead of the default 127.Pa /netbsd . 128.It Fl s 129Display the contents of the 130.Dv uvmexp 131structure. 132This contains various paging event and memory status counters. 133.It Fl t 134Display the contents of the 135.Dv vmtotal 136structure. 137This includes information about processes and virtual memory. 138.Pp 139The process part shows the number of processes in the following states: 140.Pp 141.Bl -tag -width abc -compact 142.It ru 143on the run queue 144.It dw 145in disk I/O wait 146.It pw 147waiting for paging 148.It sl 149sleeping 150.El 151.Pp 152The virtual memory section shows: 153.Pp 154.Bl -tag -width abcdefgh -compact 155.It total-v 156Total virtual memory 157.It active-v 158Active virtual memory in use 159.It active-r 160Active real memory in use 161.It vm-sh 162Shared virtual memory 163.It avm-sh 164Active shared virtual memory 165.It rm-sh 166Shared real memory 167.It arm-sh 168Active shared real memory 169.It free 170Free memory 171.El 172.Pp 173All memory values are shown in number of pages. 174.It Fl U 175Dump all UVM histories. 176.It Fl u Ar histname 177Dump the specified UVM history. 178.It Fl v 179Print more verbose information. 180When used with the 181.Fl i , 182.Fl e , 183or 184.Fl m 185options prints out all counters, not just those with non-zero values. 186.It Fl W 187Print more verbose information about kernel memory pools. 188.It Fl w Ar wait 189Pause 190.Ar wait 191seconds between each display. 192If no repeat 193.Ar count 194is specified, the default is infinity. 195The 196.Nm 197command will accept and honor a negative number of 198.Ar wait 199seconds. 200.El 201.Pp 202By default, 203.Nm 204displays the following information: 205.Bl -tag -width memory 206.It procs 207Information about the numbers of processes in various states. 208.Pp 209.Bl -tag -width abcd -compact 210.It r 211in run queue 212.It b 213blocked for resources (i/o, paging, etc.) 214.El 215.It memory 216Information about the usage of virtual and real memory. 217Virtual pages (reported in units of 1024 bytes) are considered active if 218they belong to processes which are running or have run in the last 20 219seconds. 220.Pp 221.Bl -tag -width abcd -compact 222.It avm 223active virtual pages 224.It fre 225size of the free list 226.El 227.It page 228Information about page faults and paging activity. 229These are averaged every five seconds, and given in units per second. 230.Pp 231.Bl -tag -width abcd -compact 232.It flt 233total page faults 234.It re 235page reclaims (simulating reference bits) 236.It pi 237pages paged in 238.It po 239pages paged out 240.It fr 241pages freed per second 242.It sr 243pages scanned by clock algorithm, per-second 244.El 245.It disks 246Disk transfers per second. 247Typically paging will be split across the available drives. 248The header of the field is the first character of the disk name and 249the unit number. 250If more than four disk drives are configured in the system, 251.Nm 252displays only the first four drives. 253To force 254.Nm 255to display specific drives, their names may be supplied on the command line. 256.It faults 257Trap/interrupt rate averages per second over last 5 seconds. 258.Pp 259.Bl -tag -width abcd -compact 260.It in 261device interrupts per interval (including clock interrupts) 262.It sy 263system calls per interval 264.It cs 265CPU context switch rate (switches/interval) 266.El 267.It cpu 268Breakdown of percentage usage of CPU time. 269.Pp 270.Bl -tag -width abcd -compact 271.It us 272user time for normal and low priority processes 273.It sy 274system time 275.It id 276CPU idle 277.El 278.El 279.Sh FILES 280.Bl -tag -width eeenymeeny -compact 281.It Pa /netbsd 282default kernel namelist 283.It Pa /dev/mem 284default memory file 285.El 286.Sh EXAMPLES 287The command 288.Dq Li vmstat -w 5 289will print what the system is doing every five 290seconds; this is a good choice of printing interval since this is how often 291some of the statistics are sampled in the system. 292Others vary every second and running the output for a while will make it 293apparent which are recomputed every second. 294.Sh SEE ALSO 295.Xr fstat 1 , 296.Xr netstat 1 , 297.Xr nfsstat 1 , 298.Xr ps 1 , 299.Xr systat 1 , 300.Xr iostat 8 , 301.Xr pstat 8 , 302.Xr kernhist 9 303.Sh BUGS 304The 305.Fl c 306and 307.Fl w 308options are only available with the default output. 309.Pp 310The 311.Fl l , 312.Fl U , 313and 314.Fl u 315options are useful only if the system was compiled with support for UVM 316history. 317