vmstat(1) — Commands
NAME
vmstat − Displays virtual memory statistics
SYNOPSIS
vmstat interval [count]
vmstat [−f | −M | −P | −s]
The vmstat command displays system statistics for virtual memory, processes, trap, and CPU activity.
DESCRIPTION
If you specify interval, vmstat displays the statistics listed below every interval seconds. The first report is for all time since a reboot, and each subsequent report is for the last interval only. If you specify count after interval, count specifies the number of reports. For example, vmstat 1 10 produces 10 reports at 1-second intervals. You cannot specify count without interval, since the first numeric argument to vmstat is always assumed to be interval.
At any time, system memory can be in use by the kernel in kseg, wired (pages that are currently in use and cannot be used for paging), on the active list (pages that are currently in use but can be used for paging), on the inactive list (pages that are allocated but are most likely to be used for paging), on the free list (pages that are clean and available for use), or used by the Unified Buffer Cache (UBC). The vmstat command does not report on the memory in kseg and memory used by the UBC.
The following values are displayed:
Process information:
rNumber of threads that are running or are runnable.
wNumber of threads waiting interruptibly.
uNumber of threads waiting uninterruptibly.
Virtual memory information:
actTotal number of pages on the active list, the inactive list (pages that are allocated but are most likely to be used for paging), and the Unified Buffer Cache (UBC) least recently used (LRU) list.
freeTotal number of pages that are clean and available for use.
wireTotal number of pages that are currently in use and cannot be used for paging (not a real list).
faultNumber of address translation faults that have occurred.
cowNumber of copy-on-write page faults, which occur if the requested page is shared by a parent process and one or more child processes (using the fork function) and if one of the processes needs to modify the page. In this case, VM loads a new address into the translation buffer and copies the contents of the requested page into the new address for modification by the process.
zeroNumber of zero-filled-on-demand page faults, which occur if VM cannot find the page in the internal data structures and if the requested page is new and has never been referenced. In this case, VM initializes a physical page (the contents of the page are zeroed out) and loads the address into the page table.
reactNumber of pages that have been faulted while on the inactive list.
pinNumber of requests for pages from a pager.
poutNumber of pages that have been paged out.
Interrupt information:
inNumber of nonclock device interrupts per second.
syNumber of system calls called per second.
csNumber of task and thread context switches per second.
CPU information:
usPercentage of user time for normal and priority processes.
syPercentage of system time.
idPercentage of idle time.
Specify −f to display fork statistics only. Specify −s for a single display of accumulated statistics, as well as page size.
FLAGS
−fDisplays only statistics about the number of forks since system startup (see the fork() call).
−MDisplays information about memory usage by buckets. This information can be used for kernel debugging.
−PDisplays the following accumulated statistics about physical memory use:
Total Physical Memory
Number of megabytes of installed memory, and the equivalent page value.
Physical Memory Clusters
How physical memory is clustered. The starting and ending page frames (pfn) and where the memory is utilized (pal, os, and ∗nvram).
Physical Memory Use
A breakdown of memory usage by os, The starting and ending page frames, type of usage such as unixtable, or bss and the total physical memory in use.
Managed Pages Break Down
A snapshot of where managed physical memory resided when the vmstat command executed. The display shows the number of pages in the free queue, active and inactive pages, wired pages and unified buffer cache (ubc) pages.
WIRED Pages Break Down
A further breakdown of physical pages that are wired in memory. The display typically shows:
vm and ubc wired pages
meta data, malloc, and contig pages
user, kernel, and free ptepages.
−sDisplays the following accumulated statistics along with the page size:
active pages
Total number of pages that are currently in use but can be used for paging.
inactive pages
Total number of VM pages that are allocated but are most likely to be used for paging.
free pages
Total number of unreferenced (clean) pages that are available for use.
wire pages
Total number of pages that are currently in use and cannot be used for paging (not a real list).
virtual memory page faults
Number of address translation faults that have occurred.
copy-on-write page faults
Number of copy-on-write page faults, which occur if the requested page is shared by a parent process and one or more child processes (using the fork function) and if one of the processes needs to modify the page. In this case, VM loads a new address into the translation buffer and copies the contents of the requested page into the new address for modification by the process.
zero file page faults
Number of zero-filled-on-demand page faults, which occur if VM cannot find the page in the internal data structures and if the requested page is new and has never been referenced. In this case, VM initializes a physical page (the contents of the page are zeroed out) and loads the address into the page table.
reattaches from reclaim list
Number of pages that have been faulted while on the inactive list.
pages paged in
Number of requests for pages from a pager.
pages paged out
Number of pages that have been paged out.
task and thread context switches
Number of task and thread context switches per second.
device interrupts
Number of nonclock device interrupts per second.
system calls
Number of system calls called per second.
RELATED INFORMATION
Commands: iostat(1).