linux-vmstats

Retrieves memory and I/O load levels on a Linux system. Collects swap, memory, and block I/O related metrics from the /proc/meminfo and /proc/vmstat files.

Command properties

ItemDescription
Command typeDriver query
Required permissionAdministrator
License usageLicensed command
Parallel executionNot supported
Distributed executionRuns on Data Node (mapper)

Syntax

linux-vmstats

Output fields

FieldTypeDescription
swap_sizelongTotal swap size (KiB)
free_sizelongAvailable memory size (KiB)
buffer_sizelongBuffer cache size (KiB)
cache_sizelongPage cache size (KiB)
swap_inlongNumber of pages swapped in per second
swap_outlongNumber of pages swapped out per second
block_inlongNumber of blocks read from block devices per second
block_outlongNumber of blocks written to block devices per second

Error codes

Parse errors
Error codeMessageDescription
95040no-read-permissionOccurs when a user without administrator privilege runs the command
Runtime errors

N/A

Description

The linux-vmstats command reads memory statistics (swap size, free memory, buffers, cache) from /proc/meminfo and I/O statistics (swap in/out, block in/out) from /proc/vmstat.

Swap I/O and block I/O metrics are calculated as the difference between two measurements taken 1 second apart, returning the per-second rate of change. Therefore, running this command incurs approximately 1 second of wait time. Memory-related metrics (swap size, free memory, buffers, cache) return the values from the second measurement point.

The output always contains exactly 1 record.

Examples

  1. Retrieve memory and I/O statistics

    linux-vmstats
    

    Retrieves the current memory usage and I/O load levels of the system.

  2. Check for swap activity

    linux-vmstats
    | search swap_in > 0 or swap_out > 0
    

    Checks whether swap I/O occurred in the last second. Frequent swap activity may indicate low memory conditions.