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
| Item | Description |
|---|---|
| Command type | Driver query |
| Required permission | Administrator |
| License usage | Licensed command |
| Parallel execution | Not supported |
| Distributed execution | Runs on Data Node (mapper) |
Syntax
Output fields
| Field | Type | Description |
|---|---|---|
swap_size | long | Total swap size (KiB) |
free_size | long | Available memory size (KiB) |
buffer_size | long | Buffer cache size (KiB) |
cache_size | long | Page cache size (KiB) |
swap_in | long | Number of pages swapped in per second |
swap_out | long | Number of pages swapped out per second |
block_in | long | Number of blocks read from block devices per second |
block_out | long | Number of blocks written to block devices per second |
Error codes
Parse errors
| Error code | Message | Description |
|---|---|---|
95040 | no-read-permission | Occurs 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
-
Retrieve memory and I/O statistics
linux-vmstatsRetrieves the current memory usage and I/O load levels of the system.
-
Check for swap activity
linux-vmstats | search swap_in > 0 or swap_out > 0Checks whether swap I/O occurred in the last second. Frequent swap activity may indicate low memory conditions.