VMSTAT(8)
๐ VMSTAT(8) ๐ โ like, the system manager's manual era, bestie
okay so you found vmstat(8) and you're like "what is this mysterious little command" โ don't worry, I got you. This is the group chat rundown of the virtual memory statistics reporter. Pull up a chair, grab a strawberry ๐, and let's get into it.
โจ NAME โจ
vmstat โ report virtual memory statistics ๐
๐ธ SYNOPSIS ๐ธ
vmstat [option ...] [delay [count]]
๐ฆ DESCRIPTION ๐ฆ
So vmstat is the bestie that tells you what's actually going on with your machine. It reports information about:
- processes
- memory
- paging
- block IO
- traps
- disks
- cpu activity
The first report it gives you is averages since the last reboot. Like, the whole vibe since boot. Every report after that gives you info on a sampling period of length delay. The process and memory reports are instantaneous in either case โ no cap. โญ
๐ OPTIONS ๐
delayโ the delay between updates, in seconds. If you don't specify adelay, only one report gets printed, with the average values since boot. one and done, iconic behavior.countโ number of updates. If there's nocountbutdelayis defined, the default is infinite. yes bestie, infinite. it will simply keep going forever. ๐ซถ-a,--activeโ display active and inactive memory. needs a 2.5.41 kernel or better.-f,--forksโ displays the number of forks since boot. This includes thefork,vfork, andclonesystem calls, and it's equivalent to the total number of tasks created. Each process is represented by one or more tasks, depending on thread usage. This display does not repeat.-m,--slabsโ displays slabinfo.-n,--one-headerโ display the header only once instead of periodically. one header, one moment, periodt.-s,--statsโ displays a table of various event counters and memory statistics. This display does not repeat.-d,--diskโ report disk statistics (2.5.70 or above required).-D,--disk-sumโ report some summary statistics about disk activity.-p,--partitiondevice โ detailed statistics about partition (2.5.70 or above required).-S,--unitcharacter โ switches outputs between 1000 (k), 1024 (K), 1000000 (m), or 1048576 (M) bytes. > note: this does not change the block (bi/bo) fields. no ma'am, those stay exactly where they are.-t,--timestampโ append timestamp to each line-w,--wideโ wide output mode. useful for systems with higher amounts of memory, where the default output mode suffers from unwanted column breakage. the output is wider than 80 characters per line.-y,--no-firstโ omits the first report with statistics since system boot.-V,--versionโ display version information and exit.-h,--helpโ display help and exit.
๐ FIELD DESCRIPTION FOR VM MODE ๐
๐ง Procs
r: the number of runnable processes (running or waiting for run time).b: the number of processes blocked waiting for I/O to complete.
๐ง Memory
These are affected by the --unit option.
swpd: the amount of swap memory used.free: the amount of idle memory.buff: the amount of memory used as buffers.cache: the amount of memory used as cache.inact: the amount of inactive memory. (-aoption)active: the amount of active memory. (-aoption)
๐ง Swap
These are affected by the --unit option.
si: amount of memory swapped in from disk (/s).so: amount of memory swapped to disk (/s).
๐ง IO
bi: kibibyte received from a block device (KiB/s).bo: kibibyte sent to a block device (KiB/s).
๐ง System
in: the number of interrupts per second, including the clock.cs: the number of context switches per second.
๐ง CPU
These are percentages of total CPU time.
us: time spent running non-kernel code. (user time, including nice time)sy: time spent running kernel code. (system time)id: time spent idle. Prior to Linux 2.5.41, this includes IO-wait time.wa: time spent waiting for IO. Prior to Linux 2.5.41, included in idle.st: time stolen from a virtual machine. Prior to Linux 2.6.11, unknown.gu: time spent running KVM guest code (guest time, including guest nice).
๐ฅ FIELD DESCRIPTION FOR DISK MODE ๐ฅ
๐ Reads
total: total reads completed successfullymerged: grouped reads (resulting in one I/O)sectors: sectors read successfullyms: milliseconds spent reading
๐ Writes
total: total writes completed successfullymerged: grouped writes (resulting in one I/O)sectors: sectors written successfullyms: milliseconds spent writing
๐ IO
cur: I/O in progresss: seconds spent for I/O
๐ FIELD DESCRIPTION FOR DISK PARTITION MODE ๐
reads: total number of reads issued to this partitionread sectors: total read sectors for partitionwrites: total number of writes issued to this partitionrequested writes: total number of write requests made for partition
๐ FIELD DESCRIPTION FOR SLAB MODE ๐
Slab mode shows statistics per slab. For more information about this information see slabinfo(5).
cache: cache namenum: number of currently active objectstotal: total number of available objectssize: size of each objectpages: number of pages with at least one active object
๐ NOTES ๐
vmstat requires read access to files under /proc. The -m requires read access to /proc/slabinfo, which may not be available to standard users. Mount options for /proc such as subset=pid may also impact what is visible.
fr fr, if your numbers look weird or missing, check your /proc permissions first. lowkey the number one culprit. ๐ญ
๐ SEE ALSO ๐
free(1), iostat(1), mpstat(1), ps(1), sar(1), top(1), slabinfo(5)
๐ฏ REPORTING BUGS ๐ฏ
Please send bug reports to procps@freelists.org.
and that's the whole page bestie, you ate that ๐ซถ this one's from procps-ng, dated 2024-07-19 โ so go forth, run vmstat, and watch your machine's whole soul in real time. slay โจ๐
๐ฆ where this page comes from
- alpine 3.23: procps-ng-doc 4.0.5-r0 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- alpine 3.24: procps-ng-doc 4.0.6-r0 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- arch rolling: procps-ng 4.0.7-1 ยท GPL AND LGPL
- fedora 44: procps-ng 4.0.6-1.fc44 ยท GPL-2.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later
- fedora 44: procps-ng 4.0.6-1.fc44 ยท GPL-2.0-or-later AND LGPL-2.0-or-later AND LGPL-2.1-or-later
- nixos 26.05: procps 4.0.6
- nixpkgs unstable: procps 4.0.7
- opensuse-leap 16.0: procps 4.0.5-160000.2.2 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: procps 4.0.5-160000.2.2 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: procps 4.0.5-160000.2.2 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- opensuse-leap 16.0: procps 4.0.5-160000.2.2 ยท GPL-2.0-or-later AND LGPL-2.1-or-later
- ubuntu stonking: procps 2:4.0.6-3ubuntu1 ยท LGPL-2.1-or-later
- Copyright (c) 2002-2024 Craig Small <csmall@dropbear.xyz>
- Copyright (c) 2012-2023 Jim Warner <james.warner@comcast.net>
- Copyright (c) 2011-2012 Sami Kerola <kerolasa@iki.fi>
- Copyright (c) 1994 Henry Ware <al172@yfn.ysu.edu>
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms