vmstat (''virtual memory statistics'') is a computer
system monitor
A system monitor is a hardware or software component used to monitor system resources and performance in a computer system.
Among the management issues regarding use of system monitoring tools are resource usage and privacy.
Overview
Software ...
ing tool that collects and displays summary information about
operating system
An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
memory, processes, interrupts, paging and block
I/O. Users of
vmstat
can specify a sampling interval which permits observing system activity in near-real time.
The vmstat tool is available on most
Unix
Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
and
Unix-like
A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
operating systems, such as
FreeBSD
FreeBSD is a free and open-source Unix-like operating system descended from the Berkeley Software Distribution (BSD), which was based on Research Unix. The first version of FreeBSD was released in 1993. In 2005, FreeBSD was the most popular ...
,
Linux
Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which i ...
or
Solaris.
Syntax
The syntax and output of vmstat often differs slightly between different operating systems.
# vmstat 2 6
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
0 0 2536 21496 185684 1353000 0 0 0 14 1 2 0 0 100 0
0 0 2536 21496 185684 1353000 0 0 0 28 1030 145 0 0 100 0
0 0 2536 21496 185684 1353000 0 0 0 0 1026 132 0 0 100 0
0 0 2536 21520 185684 1353000 0 0 0 0 1033 186 1 0 99 0
0 0 2536 21520 185684 1353000 0 0 0 0 1024 141 0 0 100 0
0 0 2536 21584 185684 1353000 0 0 0 0 1025 131 0 0 100 0
In the above example the tool reports every two seconds for six iterations.
We can get the customized or required outputs by using various options with the vmstat command.
;
# vmstat –s: This option is used to get ''memory statistics''.
;
# vmstat –d: This option is used to get ''disk statistics''.
See also
*
nmon — a system monitor tool for the AIX and Linux operating systems.
*
iostat
*
top
*
sar
External links
*
*
* {{man, 8, vmstat, die.net, Report virtual memory statistics
Softpanorama vmstat page
Unix software
System monitors