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 forceslsmemto 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 inlsmemoutput. 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,--outputlist โ specify which output columns to print. use--helpto 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 ofkey="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,--splitlist โ specify which columns are used to split memory blocks into ranges. the supported columns areSTATE,REMOVABLE,NODE,ZONES,CONFIGURED,MEMMAP-ON-MEMORY, andnone. other column names are silently ignored. for more details see DESCRIPTION above. (yes bestie, scroll back up, I know ๐)-s,--sysrootdirectory โ gather memory data for a Linux instance other than the instance from which thelsmemcommand 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 benever,alwaysoronly. if the when argument is omitted, it defaults toonly. 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--helpcan 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 arecompactfor JSON output with minimal whitespace, andlinesfor 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 ๐ฅ
๐ 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