LSMEM(1)

๐ŸŒธ NAME ๐ŸŒธ

okay so bestie, welcome to lsmem(1) โ€” a User Command, and it's literally here to list the ranges of available memory with their online status ๐Ÿ’–


โœจ SYNOPSIS โœจ

lsmem [options]

๐Ÿ’… DESCRIPTION ๐Ÿ’…

so what lsmem does is list the ranges of available memory, together with their online status. the memory blocks it lists correspond to the memory block representation in sysfs. it also shows you the size of a single memory block, plus the total amounts of memory in online and offline state. iconic, honestly ๐Ÿ‘‘

the default output is compatible with the original implementation from s390-tools, but strongly recommended to avoid using default outputs in your scripts. like fr fr. always explicitly define the expected columns by using the --output option together with a columns list in environments where you need a stable output. no cap.

lsmem always lists a new memory range when the current memory block differs from the previous block by some output column. that 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. the way that these two just vibe in opposite directions?? obsessed ๐Ÿฆ‹

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. so likeโ€ฆ be careful with that one ๐Ÿ’€

the supported columns are RANGE, SIZE, STATE, REMOVABLE, BLOCK, NODE, ZONES, CONFIGURED, and MEMMAP-ON-MEMORY.

๐ŸŒˆ RANGE

the start and end physical addresses of the memory range.

๐ŸŒˆ SIZE

the size of the memory range, representing the total amount of memory in that range.

๐ŸŒˆ STATE

the current online status of the memory range. common states include online, offline, and transitional states.

๐ŸŒˆ REMOVABLE

whether the memory is removable.

๐ŸŒˆ BLOCK

the specific memory block number or range.

๐ŸŒˆ NODE

the NUMA (Non-Uniform Memory Access) node to which the memory block belongs.

๐ŸŒˆ ZONES

the memory zones to which the blocks belongs, such as DMA, Normal, Movable.

๐ŸŒˆ CONFIGURED

the configuration state of a memory block. refer to chmem(8) for details on configuring or deconfiguring memory blocks.

๐ŸŒˆ MEMMAP-ON-MEMORY

the memmap-on-memory state of the memory block at configuration time. this setting indicates where memory hotplug stores its internal metadata (the struct pages array or memmap). if MEMMAP-ON-MEMORY is set to 1, the metadata is allocated directly from the newly added hotplugged memory, enabling hot-add operations even when the system is under high memory pressure. if set to 0, the memmap metadata is allocated from existing system memory. it's giving "where do we keep the receipts" energy ๐Ÿงพ


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. like you gotta get ready before you go out, periodt ๐Ÿ’…

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 โ€” list each individual memory block, instead of combining memory blocks with similar attributes. every single one, no merging, main character behavior โœจ
  • -b, --bytes โ€” print sizes in bytes rather than in human-readable form.

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, .... lowercase-core but make it bytes ๐Ÿ“

  • -J, --json โ€” use JSON output format.
  • -n, --noheadings โ€” do not print a header line.
  • -o, --output list โ€” specify which output columns to print. use --help to obtain a list of all supported columns. to extend the default list of columns specify list in the format +list. for example, lsmem -o +NODE. okay that plus sign is doing a LOT of work and I respect it ๐Ÿ’œ
  • --output-all โ€” output all available columns. all of them. the whole buffet ๐Ÿ‘‘
  • -P, --pairs โ€” produce output in the form of key="value" pairs. all potentially unsafe value characters are hex-escaped (\x<code>).
  • -r, --raw โ€” produce output in raw format. all potentially unsafe characters are hex-escaped (\x<code>).
  • -S, --split list โ€” specify which columns are used to split memory blocks into ranges. the supported columns are STATE, REMOVABLE, NODE, ZONES, CONFIGURED, MEMMAP-ON-MEMORY, and none. other column names are silently ignored. for more details see DESCRIPTION above. (yes bestie, scroll back up, I know ๐Ÿ™ˆ)
  • -s, --sysroot directory โ€” gather memory data for a Linux instance other than the instance from which the lsmem command is issued. the specified directory is the system root of the Linux instance to be inspected. visiting rights but for a whole other system root ๐Ÿฆ‹
  • --summary[=when] โ€” this option controls summary lines output. the optional argument when can be never, always or only. if the when argument is omitted, it defaults to only. the summary output is suppressed for --raw, --pairs, and --json.
  • -h, --help โ€” display help text and exit.
  • -V, --version โ€” display version and exit.

๐ŸŒฑ ENVIRONMENT ๐ŸŒฑ

  • LSMEM_COLUMNS โ€” specifies a comma-separated list of output columns to print. all columns listed in --help can be used.
  • LIBSMARTCOLS_DEBUG=all โ€” enables libsmartcols debug output.
  • LIBSMARTCOLS_DEBUG_PADDING=on โ€” use visible padding characters.
  • LIBSMARTCOLS_JSON=compact|lines โ€” controls JSON output format when using --json. supported values are compact for JSON output with minimal whitespace, and lines for JSON Lines format (one JSON object per line). if unset or set to any other value, pretty-printed JSON is used.

๐Ÿ‘‘ 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. shoutout to the founders and the glow-up crew ๐Ÿซถ


๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

chmem(8)


๐Ÿ’€ 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/.


and that's the whole page bestie, no crumbs left ๐Ÿ“ this was util-linux 2.42.4, dated 2026-09-21 โ€” go forth and list those memory ranges, you absolute icon ๐Ÿ’–โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from
  • arch rolling: util-linux 2.42.4-1 ยท BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND ISC AND LGPL-2.1-or-later AND LicenseRef-PublicDomain
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms