LSMEM(1) | User Commands | LSMEM(1) |
lsmem - list the ranges of available memory with their online status
lsmem [options]
The lsmem command lists the ranges of available memory with their online status. The listed memory blocks correspond to the memory block representation in sysfs. The command also shows the memory block size and the amount of memory in online and offline state.
The default output is compatible with original implementation from s390-tools, but it’s strongly recommended to avoid using default outputs in your scripts. Always explicitly define expected columns by using the --output option together with a columns list in environments where a stable output is required.
The lsmem command lists a new memory range always when the current memory block distinguish from the previous block by some output column. This default behavior is possible to override by the --split option (e.g., lsmem --split=ZONES). The special word "none" may be used to ignore all differences between memory blocks and to create as large as possible continuous ranges. The opposite semantic is --all to list individual memory blocks.
Note that some output columns may provide inaccurate information if a split policy forces lsmem to ignore differences in some attributes. For example if you merge removable and non-removable memory blocks to the one range than all the range will be marked as non-removable on lsmem output.
Not all columns are supported on all systems. If an unsupported column is specified, lsmem prints the column but does not provide any data for it.
Use the --help option to see the columns description.
-a, --all
-b, --bytes
By default, the unit, sizes are expressed in, is byte, and unit prefixes are in power of 2^10 (1024). Abbreviations of symbols are exhibited truncated in order to reach a better readability, by exhibiting alone the first letter of them; examples: "1 KiB" and "1 MiB" are respectively exhibited as "1 K" and "1 M", then omitting on purpose the mention "iB", which is part of these abbreviations.
-J, --json
-n, --noheadings
-o, --output list
--output-all
-P, --pairs
-r, --raw
-S, --split list
-s, --sysroot directory
-h, --help
-V, --version
--summary[=when]
lsmem was originally written by Gerald Schaefer for s390-tools in Perl. The C version for util-linux was written by Clemens von Mann, Heiko Carstens and Karel Zak.
For bug reports, use the issue tracker at <https://github.com/util-linux/util-linux/issues>.
The lsmem command is part of the util-linux package which can be downloaded from Linux Kernel Archive <https://www.kernel.org/pub/linux/utils/util-linux/>.
2022-05-11 | util-linux 2.38.1 |