table of contents
| LSMEM(1) | User Commands | LSMEM(1) |
NAME¶
lsmem - list the ranges of available memory with their online status
SYNOPSIS¶
lsmem [options]
DESCRIPTION¶
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 size of a single memory block and the total amounts of memory in online and offline state.
The default output is compatible with the 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 always lists a new memory range when the current memory block differs from the previous block by some output column. This default behavior can be overridden with the --split option (for example: lsmem --split=ZONES). The special word none may be used with --split to ignore all differences between memory blocks and to create contiguous ranges that are as large as possible. The opposite semantics has --all, which lists all individual memory blocks.
Note that some output columns may provide inaccurate information if a splitting policy forces lsmem to ignore differences in some attributes. For example, if you merge removable and non-removable memory blocks into a single range, then the whole range will be marked as non-removable in lsmem output.
The supported columns are RANGE, SIZE, STATE, REMOVABLE, BLOCK, NODE, ZONES, CONFIGURED, and MEMMAP-ON-MEMORY.
RANGE
SIZE
STATE
REMOVABLE
BLOCK
NODE
ZONES
CONFIGURED
MEMMAP-ON-MEMORY
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. Additionally, lsmem may skip columns like CONFIGURED or MEMMAP-ON-MEMORY if these states are not relevant to the system’s architecture.
On systems that can configure/deconfigure memory, memory needs to be configured before it can come online.
The "Memmap on memory parameter" summary line shows the global memmap-on-memory setting for memory_hotplug. This is typically set on the kernel command line via memory_hotplug.memmap_on_memory.
OPTIONS¶
-a, --all
-b, --bytes
By default, sizes are shown in units that are powers of 1024 bytes. The formal abbreviations for these units (KiB, MiB, GiB, ...) are further shortened to just their first letter: K, M, G, ....
-J, --json
-n, --noheadings
-o, --output list
--output-all
-P, --pairs
-r, --raw
-S, --split list
-s, --sysroot directory
--summary[=when]
-h, --help
-V, --version
ENVIRONMENT¶
LSMEM_COLUMNS
LIBSMARTCOLS_DEBUG=all
LIBSMARTCOLS_DEBUG_PADDING=on
LIBSMARTCOLS_JSON=compact|lines
AUTHORS¶
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.
SEE ALSO¶
REPORTING BUGS¶
For bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>.
AVAILABILITY¶
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/>.
| 2026-04-01 | util-linux 2.42 |