Content
Data
license:
Version number: util-linux 2.33.1 (in Debian 10)
Developer / owner:
Short description:
Manual page and help for the lsmem linux command. The lsmem command lists the ranges of available memory and their online states. The listed memory blocks correspond to the representation of the memory block in sysf. The command displays the size of the memory block and the amount of memory both online and offline.
The default output of progtam is compatible with the original implementation of s390 devices, but it is strongly recommended to avoid using default outputs in our scripts. You should always specify the expected columns for --output with the option and column listing in applications where stable output is essential.
The lsmem command always lists a new memory range if the current memory block differs from the previous block by some output column. This default operation can be overridden by --split option (eg Lsmem --split = ZONES). Using the special word "none" ignores the differences between memory blocks and returns the largest possible contiguous memory range. The opposite approach is a --all switch, the command lists all individual memory blocks.
Note that some output columns may provide inaccurate information if the split policy forces lsmem to ignore differences in certain attributes. For example, if you combine removable and non-removable memory blocks into one domain, all domains will be marked as non-removable in the lsmem output.
Not all columns are supported on all systems. If an unsupported column is specified, lsmem displays the column but does not specify data in it.
Man page output
man lsmem
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 com‐ mand also shows the memory block size and the amount of memory in online and offline state. The default output compatible with original implementation from s390-tools, but it's strongly recommended to avoid using default outputs in your scripts. Always explic‐ itly 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 dis‐ tinguish 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 indi‐ vidual 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 re‐ movable 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. OPTIONS -a, --all List each individual memory block, instead of combining memory blocks with similar attributes. -b, --bytes Print the SIZE column in bytes rather than in a human-readable format. -h, --help Display help text and exit. -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 get a list of all sup‐ ported columns. The default list of columns may be extended if list is speci‐ fied in the format +list (e.g. lsmem -o +NODE). --output-all Output all available columns. -P, --pairs Produce output in the form of key="value" pairs. All potentially unsafe char‐ acters are hex-escaped (\x<code>). -r, --raw Produce output in raw format. All potentially unsafe characters are hex-es‐ caped (\x<code>). -S, --split list Specify which columns (attributes) use to split memory blocks to ranges. The supported columns are STATE, REMOVABLE, NODE and ZONES, or "none". The another columns are silently ignored. For more details see DESCRIPTION above. -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. -V, --version Display version information and exit. --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. AUTHOR 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 chmem(8) AVAILABILITY The lsmem command is part of the util-linux package and is available from Linux Kernel Archive ⟨https://www.kernel.org/pub/linux/utils/util-linux/⟩. util-linux October 2016 LSMEM(1)
Help output
lsmem --help
Usage: lsmem [options] List the ranges of available memory with their online status. Options: -J, --json use JSON output format -P, --pairs use key="value" output format -a, --all list each individual memory block -b, --bytes print SIZE in bytes rather than in human readable format -n, --noheadings don't print headings -o, --output <list> output columns --output-all output all columns -r, --raw use raw output format -S, --split <list> split ranges by specified columns -s, --sysroot <dir> use the specified directory as system root --summary[=when] print summary information (never,always or only) -h, --help display this help -V, --version display version Available output columns: RANGE start and end address of the memory range SIZE size of the memory range STATE online status of the memory range REMOVABLE memory is removable BLOCK memory block number or blocks range NODE numa node of memory ZONES valid zones for the memory range For more details see lsmem(1).
Related Content
- 15 views