$ vmstat -S M
Output:
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
3 0 0 1963 607 2359 0 0 0 0 0 1 32 0 68 0
- The fist line is nothing but six different categories. The second line gives more information about each category. This second line gives all data you need.
- -S M: vmstat lets you choose units (k, K, m, M) default is K (1024 bytes) in the default mode. I am using M since this system has over 4 GB memory. Without -M option it will use K as unit
$ vmstat
Output:
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
3 0 0 2485120 621952 2415368 0 0 0 0 0 1 32 0 68 0
Field Description For Vm Mode
(a) procs is the process-related fields are:
- r: The number of processes waiting for run time.
- b: The number of processes in uninterruptible sleep.
(b) memory is the memory-related fields are:
- swpd: the amount of virtual memory used.
- free: the amount of idle memory.
- buff: the amount of memory used as buffers.
- cache: the amount of memory used as cache.
(c) swap is swap-related fields are:
- si: Amount of memory swapped in from disk (/s).
- so: Amount of memory swapped to disk (/s).
(d) io is the I/O-related fields are:
- bi: Blocks received from a block device (blocks/s).
- bo: Blocks sent to a block device (blocks/s).
(e) system is the system-related fields are:
- in: The number of interrupts per second, including the clock.
- cs: The number of context switches per second.
(f) cpu is the CPU-related fields are:
- 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, shown as zero.
$ vmstat -S M 2
OR
$ vmstat -S M 2 5
Output:
procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
3 0 0 1756 607 2359 0 0 0 0 0 1 32 0 68 0
3 0 0 1756 607 2359 0 0 0 0 1018 65 38 0 62 0
3 0 0 1756 607 2359 0 0 0 0 1011 64 37 0 63 0
3 0 0 1756 607 2359 0 0 0 20 1018 72 37 0 63 0
3 0 0 1756 607 2359 0 0 0 0 1012 64 37 0 62 0
3 0 0 1756 607 2359 0 0 0 0 1011 65 38 0 63 0
3 0 0 1995 607 2359 0 0 0 0 1012 62 35 2 63 0
3 0 0 1731 607 2359 0 0 0 0 1012 64 34 3 62 0
3 0 0 1731 607 2359 0 0 0 0 1013 72 38 0 62 0
3 0 0 1731 607 2359 0 0 0 0 1013 63 37 0 63 0