1*aac8c56eSmrg.\" $NetBSD: vmstat.1,v 1.26 2022/02/09 07:34:08 mrg Exp $ 2553c8f83Swiz.\" 39b336836Sad.\" Copyright (c) 2000, 2007 The NetBSD Foundation, Inc. 4553c8f83Swiz.\" All rights reserved. 5553c8f83Swiz.\" 6553c8f83Swiz.\" Redistribution and use in source and binary forms, with or without 7553c8f83Swiz.\" modification, are permitted provided that the following conditions 8553c8f83Swiz.\" are met: 9553c8f83Swiz.\" 1. Redistributions of source code must retain the above copyright 10553c8f83Swiz.\" notice, this list of conditions and the following disclaimer. 11553c8f83Swiz.\" 2. Redistributions in binary form must reproduce the above copyright 12553c8f83Swiz.\" notice, this list of conditions and the following disclaimer in the 13553c8f83Swiz.\" documentation and/or other materials provided with the distribution. 14553c8f83Swiz.\" 15553c8f83Swiz.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 16553c8f83Swiz.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17553c8f83Swiz.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18553c8f83Swiz.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19553c8f83Swiz.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20553c8f83Swiz.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21553c8f83Swiz.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22553c8f83Swiz.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23553c8f83Swiz.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24553c8f83Swiz.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25553c8f83Swiz.\" POSSIBILITY OF SUCH DAMAGE. 26553c8f83Swiz.\" 27553c8f83Swiz.\" Copyright (c) 1986, 1993 28553c8f83Swiz.\" The Regents of the University of California. All rights reserved. 29553c8f83Swiz.\" 30553c8f83Swiz.\" Redistribution and use in source and binary forms, with or without 31553c8f83Swiz.\" modification, are permitted provided that the following conditions 32553c8f83Swiz.\" are met: 33553c8f83Swiz.\" 1. Redistributions of source code must retain the above copyright 34553c8f83Swiz.\" notice, this list of conditions and the following disclaimer. 35553c8f83Swiz.\" 2. Redistributions in binary form must reproduce the above copyright 36553c8f83Swiz.\" notice, this list of conditions and the following disclaimer in the 37553c8f83Swiz.\" documentation and/or other materials provided with the distribution. 3889aaa1bbSagc.\" 3. Neither the name of the University nor the names of its contributors 39553c8f83Swiz.\" may be used to endorse or promote products derived from this software 40553c8f83Swiz.\" without specific prior written permission. 41553c8f83Swiz.\" 42553c8f83Swiz.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 43553c8f83Swiz.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 44553c8f83Swiz.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 45553c8f83Swiz.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 46553c8f83Swiz.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 47553c8f83Swiz.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 48553c8f83Swiz.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 49553c8f83Swiz.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 50553c8f83Swiz.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 51553c8f83Swiz.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 52553c8f83Swiz.\" SUCH DAMAGE. 53553c8f83Swiz.\" 54553c8f83Swiz.\" @(#)vmstat.8 8.1 (Berkeley) 6/6/93 55553c8f83Swiz.\" 56*aac8c56eSmrg.Dd February 1, 2022 5762bf3a2bSenami.Dt VMSTAT 1 58553c8f83Swiz.Os 59553c8f83Swiz.Sh NAME 60553c8f83Swiz.Nm vmstat 61553c8f83Swiz.Nd report virtual memory statistics 62553c8f83Swiz.Sh SYNOPSIS 63990562bfSwiz.Nm 649b336836Sad.Op Fl CefHiLlmstUvW 65553c8f83Swiz.Op Fl c Ar count 66ff1761beSlukem.Op Fl h Ar hashname 672ad86c0bSwiz.Op Fl M Ar core 682ad86c0bSwiz.Op Fl N Ar system 69*aac8c56eSmrg.Op Fl n Ar diskcount 709ba7f648Slukem.Op Fl u Ar histname 71553c8f83Swiz.Op Fl w Ar wait 72553c8f83Swiz.Op Ar disks 73553c8f83Swiz.Sh DESCRIPTION 74553c8f83Swiz.Nm 75553c8f83Swizreports certain kernel statistics kept about process, virtual memory, 762ad86c0bSwizdisk, trap, and CPU activity. 77daf84217SsevanIf 78daf84217Ssevan.Nm 79daf84217Ssevanis invoked without any options, it displays the summary of statistics since 80daf84217Ssevanboot and exits. 81daf84217SsevanThis is also referred to as the first line of 82daf84217Ssevan.Nm . 83553c8f83Swiz.Pp 84553c8f83SwizThe options are as follows: 859ba7f648Slukem.Bl -tag -width xxxhistname 869b336836Sad.It Fl C 879b336836SadReport on kernel memory caches. 889b336836SadCombine with the 899b336836Sad.Fl m 909b336836Sadoption to see information about memory pools that back the caches. 91553c8f83Swiz.It Fl c Ar count 92553c8f83SwizRepeat the display 93553c8f83Swiz.Ar count 94553c8f83Swiztimes. 95553c8f83SwizThe first display is for the time since a reboot and each subsequent report 96553c8f83Swizis for the time period since the last display. 97553c8f83SwizIf no 98553c8f83Swiz.Ar wait 99553c8f83Swizinterval is specified, the default is 1 second. 100553c8f83Swiz.It Fl e 101553c8f83SwizReport the values of system event counters. 102553c8f83Swiz.It Fl f 103553c8f83SwizReport fork statistics. 1042ad86c0bSwiz.It Fl H 1052ad86c0bSwizReport all hash table statistics. 106ff1761beSlukem.It Fl h Ar hashname 107ff1761beSlukemReport hash table statistics for 108ff1761beSlukem.Ar hashname . 109553c8f83Swiz.It Fl i 110553c8f83SwizReport the values of system interrupt counters. 111ff1761beSlukem.It Fl L 112ff1761beSlukemList all the hashes supported for 113ff1761beSlukem.Fl h 114ff1761beSlukemand 115ff1761beSlukem.Fl H . 1162ad86c0bSwiz.It Fl l 1172ad86c0bSwizList the UVM histories being maintained by the kernel. 1182ad86c0bSwiz.It Fl M Ar core 1192ad86c0bSwizExtract values associated with the name list from the specified core 1202ad86c0bSwizinstead of the default 1212ad86c0bSwiz.Pa /dev/mem . 122553c8f83Swiz.It Fl m 12380f785edSsimonbReport on the list of the kernel memory pools and their usage. 1242ad86c0bSwiz.It Fl N Ar system 1252ad86c0bSwizExtract the name list from the specified system instead of the default 1262ad86c0bSwiz.Pa /netbsd . 127*aac8c56eSmrg.It Fl n Ar diskcount 128*aac8c56eSmrgDisplay up to 129*aac8c56eSmrg.Ar diskcount 130*aac8c56eSmrgdisks in the standard output, instead of the default 2. 131553c8f83Swiz.It Fl s 132553c8f83SwizDisplay the contents of the 13365dd7f43Sross.Dv uvmexp 134be8ae688Sgrantstructure. 135be8ae688SgrantThis contains various paging event and memory status counters. 1365f8555bcShe.It Fl t 1375f8555bcSheDisplay the contents of the 1385f8555bcShe.Dv vmtotal 1395f8555bcShestructure. 1405f8555bcSheThis includes information about processes and virtual memory. 1415f8555bcShe.Pp 1425f8555bcSheThe process part shows the number of processes in the following states: 1435f8555bcShe.Pp 1445f8555bcShe.Bl -tag -width abc -compact 1455f8555bcShe.It ru 1465f8555bcSheon the run queue 1475f8555bcShe.It dw 1485f8555bcShein disk I/O wait 1495f8555bcShe.It pw 1505f8555bcShewaiting for paging 1515f8555bcShe.It sl 15240cf6f36Srmindsleeping 1535f8555bcShe.El 1545f8555bcShe.Pp 1555f8555bcSheThe virtual memory section shows: 1565f8555bcShe.Pp 1575f8555bcShe.Bl -tag -width abcdefgh -compact 1585f8555bcShe.It total-v 1595f8555bcSheTotal virtual memory 1605f8555bcShe.It active-v 1615f8555bcSheActive virtual memory in use 1625f8555bcShe.It active-r 1635f8555bcSheActive real memory in use 1645f8555bcShe.It vm-sh 1655f8555bcSheShared virtual memory 1665f8555bcShe.It avm-sh 1675f8555bcSheActive shared virtual memory 1685f8555bcShe.It rm-sh 1695f8555bcSheShared real memory 1705f8555bcShe.It arm-sh 1715f8555bcSheActive shared real memory 1725f8555bcShe.It free 1735f8555bcSheFree memory 1745f8555bcShe.El 1755f8555bcShe.Pp 1765f8555bcSheAll memory values are shown in number of pages. 1779ba7f648Slukem.It Fl U 1789ba7f648SlukemDump all UVM histories. 1792ad86c0bSwiz.It Fl u Ar histname 1802ad86c0bSwizDump the specified UVM history. 181553c8f83Swiz.It Fl v 182be8ae688SgrantPrint more verbose information. 183be8ae688SgrantWhen used with the 1848e5fd098Sdsl.Fl i , 1852ad86c0bSwiz.Fl e , 1868e5fd098Sdslor 1878e5fd098Sdsl.Fl m 1888e5fd098Sdsloptions prints out all counters, not just those with non-zero values. 189048c86fdSsimonb.It Fl W 190048c86fdSsimonbPrint more verbose information about kernel memory pools. 191553c8f83Swiz.It Fl w Ar wait 192553c8f83SwizPause 193553c8f83Swiz.Ar wait 194553c8f83Swizseconds between each display. 195553c8f83SwizIf no repeat 196553c8f83Swiz.Ar count 197553c8f83Swizis specified, the default is infinity. 198fd25e7cfSsevanThe 199fd25e7cfSsevan.Nm 200fd25e7cfSsevancommand will accept and honor a negative number of 201fd25e7cfSsevan.Ar wait 202fd25e7cfSsevanseconds. 203553c8f83Swiz.El 204553c8f83Swiz.Pp 205553c8f83SwizBy default, 206553c8f83Swiz.Nm 207553c8f83Swizdisplays the following information: 208553c8f83Swiz.Bl -tag -width memory 209553c8f83Swiz.It procs 210553c8f83SwizInformation about the numbers of processes in various states. 211553c8f83Swiz.Pp 212553c8f83Swiz.Bl -tag -width abcd -compact 213553c8f83Swiz.It r 214553c8f83Swizin run queue 215553c8f83Swiz.It b 216553c8f83Swizblocked for resources (i/o, paging, etc.) 217553c8f83Swiz.El 218553c8f83Swiz.It memory 219553c8f83SwizInformation about the usage of virtual and real memory. 220553c8f83SwizVirtual pages (reported in units of 1024 bytes) are considered active if 221553c8f83Swizthey belong to processes which are running or have run in the last 20 222553c8f83Swizseconds. 223553c8f83Swiz.Pp 224553c8f83Swiz.Bl -tag -width abcd -compact 225553c8f83Swiz.It avm 226553c8f83Swizactive virtual pages 227553c8f83Swiz.It fre 228553c8f83Swizsize of the free list 229553c8f83Swiz.El 230553c8f83Swiz.It page 231553c8f83SwizInformation about page faults and paging activity. 232d5d43c48SwizThese are averaged every five seconds, and given in units per second. 233553c8f83Swiz.Pp 234553c8f83Swiz.Bl -tag -width abcd -compact 235553c8f83Swiz.It flt 236553c8f83Swiztotal page faults 237553c8f83Swiz.It re 238553c8f83Swizpage reclaims (simulating reference bits) 239553c8f83Swiz.It pi 240553c8f83Swizpages paged in 241553c8f83Swiz.It po 242553c8f83Swizpages paged out 243553c8f83Swiz.It fr 244553c8f83Swizpages freed per second 245553c8f83Swiz.It sr 246553c8f83Swizpages scanned by clock algorithm, per-second 247553c8f83Swiz.El 248553c8f83Swiz.It disks 249553c8f83SwizDisk transfers per second. 250553c8f83SwizTypically paging will be split across the available drives. 251553c8f83SwizThe header of the field is the first character of the disk name and 252553c8f83Swizthe unit number. 253553c8f83SwizIf more than four disk drives are configured in the system, 254553c8f83Swiz.Nm 255553c8f83Swizdisplays only the first four drives. 256553c8f83SwizTo force 257553c8f83Swiz.Nm 258553c8f83Swizto display specific drives, their names may be supplied on the command line. 259553c8f83Swiz.It faults 260553c8f83SwizTrap/interrupt rate averages per second over last 5 seconds. 261553c8f83Swiz.Pp 262553c8f83Swiz.Bl -tag -width abcd -compact 263553c8f83Swiz.It in 264553c8f83Swizdevice interrupts per interval (including clock interrupts) 265553c8f83Swiz.It sy 266553c8f83Swizsystem calls per interval 267553c8f83Swiz.It cs 268f582138cSwizCPU context switch rate (switches/interval) 269553c8f83Swiz.El 270553c8f83Swiz.It cpu 271553c8f83SwizBreakdown of percentage usage of CPU time. 272553c8f83Swiz.Pp 273553c8f83Swiz.Bl -tag -width abcd -compact 274553c8f83Swiz.It us 275553c8f83Swizuser time for normal and low priority processes 276553c8f83Swiz.It sy 277553c8f83Swizsystem time 278553c8f83Swiz.It id 279f582138cSwizCPU idle 280553c8f83Swiz.El 281553c8f83Swiz.El 282d5d43c48Swiz.Sh FILES 283d5d43c48Swiz.Bl -tag -width eeenymeeny -compact 284d5d43c48Swiz.It Pa /netbsd 285d5d43c48Swizdefault kernel namelist 286d5d43c48Swiz.It Pa /dev/mem 287d5d43c48Swizdefault memory file 288d5d43c48Swiz.El 289553c8f83Swiz.Sh EXAMPLES 2909ba7f648SlukemThe command 2919ba7f648Slukem.Dq Li vmstat -w 5 2929ba7f648Slukemwill print what the system is doing every five 293553c8f83Swizseconds; this is a good choice of printing interval since this is how often 294553c8f83Swizsome of the statistics are sampled in the system. 295553c8f83SwizOthers vary every second and running the output for a while will make it 296553c8f83Swizapparent which are recomputed every second. 297553c8f83Swiz.Sh SEE ALSO 298553c8f83Swiz.Xr fstat 1 , 299553c8f83Swiz.Xr netstat 1 , 300553c8f83Swiz.Xr nfsstat 1 , 301553c8f83Swiz.Xr ps 1 , 302553c8f83Swiz.Xr systat 1 , 303553c8f83Swiz.Xr iostat 8 , 30492ffdc1dSsevan.Xr pstat 8 , 30592ffdc1dSsevan.Xr kernhist 9 306553c8f83Swiz.Sh BUGS 307553c8f83SwizThe 308*aac8c56eSmrg.Fl c , 309*aac8c56eSmrg.Fl n , 310553c8f83Swizand 311553c8f83Swiz.Fl w 312553c8f83Swizoptions are only available with the default output. 313553c8f83Swiz.Pp 314553c8f83SwizThe 3159ba7f648Slukem.Fl l , 3162ad86c0bSwiz.Fl U , 317553c8f83Swizand 3182ad86c0bSwiz.Fl u 319553c8f83Swizoptions are useful only if the system was compiled with support for UVM 320553c8f83Swizhistory. 321