CHMEM(8)

๐Ÿ’– CHMEM(8) ๐Ÿ’–

okay bestie, gather round, because today we're talking about chmem โ€” the configure memory girlie. she lives in section 8 (system administration, very demure, very mindful) and she's about to become your new obsession. โœจ


๐ŸŒธ NAME ๐ŸŒธ

chmem โ€” configure memory ๐Ÿ’…


โœจ SYNOPSIS โœจ

chmem [-h] [-V] [-v] [-c|-e|-d|-g] [SIZE|RANGE|-b BLOCKRANGE] [-z ZONE]
[-m MEMMAP-ON-MEMORY]

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so basically, the chmem command sets a particular size or range of memory online or offline. that's the whole vibe. no cap.

  • SIZE โ€” write it as <size>[m|M|g|G]. if you use m or M, then <size> is the memory size in MiB (that's 1024 x 1024 bytes, bestie). if you use g or G, then <size> is the memory size in GiB (which is 1024 x 1024 x 1024 bytes, she's big). and if you don't say anything at all? the default unit is MiB. ๐Ÿ˜Œ
  • RANGE โ€” write it in the form 0x<start>-0x<end>, exactly like it shows up in the output of the lsmem(1) command. <start> is the hexadecimal address of the first byte and <end> is the hexadecimal address of the last byte in the memory range. ๐Ÿ’–
  • BLOCKRANGE โ€” write it in the form <first>-<last> or just <block>, like the output of lsmem(1) shows you. <first> is the number of the first memory block and <last> is the number of the last memory block in the memory range. or alternatively you can just name a single block, because sometimes one is enough. ๐ŸŽ€ heads up: BLOCKRANGE requires the --blocks option.
  • ZONE โ€” this is the name of a memory zone, like the output of lsmem -o +ZONES shows you. that output shows one or more valid memory zones for each memory range. if multiple zones show up, then the memory range currently belongs to the first zone. by default, chmem will set memory online to the zone Movable, if that's among the valid zones. you can change that default by specifying the --zone option with another valid zone. for memory ballooning, it is recommended to select the zone Movable for memory online and offline, if possible. memory in this zone is much more likely to be able to be offlined again, but it cannot be used for arbitrary kernel allocations, only for migratable pages (e.g., anonymous and page cache pages). and if you want to see all available zones, use the --help option. ๐Ÿ‘‘
  • MEMMAP-ON-MEMORY โ€” write it as 1 or 0. a value of 1 allocates hotplug metadata (such as the struct pages array) from the hotplug memory itself, enabling hot-add operations even under memory pressure and without requiring additional system memory to do so. a value of 0 stores hotplugged memory metadata in regular system memory, which helps avoid issues related to fragmentation of continuous physical memory across memory blocks. the value can only be set when the memory block is in a deconfigured state, and --memmap-on-memory is valid only with --configure. if you don't specify it, and if it's supported, chmem uses the default value shown in lsmem output. ๐Ÿซถ

the --enable option configures the memory, if this is supported by the architecture. and if configuring memory is not supported by the architecture, --enable still brings the memory online. she's flexible like that. ๐Ÿ’โ€โ™€๏ธ

the --disable option brings the memory offline and performs an optional deconfigure step if this is supported by the architecture.

the --configure option requests memory from the hypervisor without bringing it online, when supported by the architecture, allowing explicit control and use of --memmap-on-memory. main character energy, honestly.

the --deconfigure option returns memory resources to the hypervisor if supported by the architecture.

โš ๏ธ okay so this part matters: SIZE and RANGE must be aligned to the Linux memory block size, as shown in the output of the lsmem(1) command. don't skip this. fr fr.

setting memory online can fail for various reasons. on virtualized systems it can fail if the hypervisor does not have enough memory left, for example because memory was overcommitted. setting memory offline can fail if Linux cannot free the memory. and if only part of the requested memory can be set online or offline, a message tells you how much memory was set online or offline instead of the requested amount. ๐Ÿ˜ญ it's giving "we tried our best".

when setting memory online or when configuring memory, chmem starts with the lowest memory block numbers. when setting memory offline or deconfiguring memory, chmem starts with the highest memory block numbers. she has a system. respect it. โœจ


๐ŸŒˆ ARCHITECTURE ๐ŸŒˆ

  • s390 architecture:

MEMMAP-ON-MEMORY: for memory blocks configured online at boot, the default value is 0 because they are added without memmap-on-memory support. memory added dynamically at runtime uses the default value displayed in lsmem output.


๐Ÿ’… OPTIONS ๐Ÿ’…

  • -b, --blocks โ€” use a BLOCKRANGE parameter instead of RANGE or SIZE for the --enable and --disable options.
  • -c, --configure โ€” set the specified RANGE, SIZE, or BLOCKRANGE of memory to be configured.
  • -d, --disable โ€” set the specified RANGE, SIZE, or BLOCKRANGE of memory offline.
  • -e, --enable โ€” set the specified RANGE, SIZE, or BLOCKRANGE of memory online.
  • -g, --deconfigure โ€” set the specified RANGE, SIZE, or BLOCKRANGE of memory to be deconfigured.
  • -m, --memmap-on-memory โ€” select memmap-on-memory for the specified RANGE, SIZE, or BLOCKRANGE of memory. this option is valid only with --configure.
  • -z, --zone โ€” select the memory ZONE where to set the specified RANGE, SIZE, or BLOCKRANGE of memory online or offline. by default, memory will be set online to the zone Movable, if possible.
  • -v, --verbose โ€” verbose mode. causes chmem to print debugging messages about its progress. she's telling you everything. ๐Ÿ—ฃ๏ธ
  • -h, --help โ€” display help text and exit.
  • -V, --version โ€” display version and exit.

๐ŸŽ€ EXIT STATUS ๐ŸŽ€

chmem has the following exit status values:

  1. 0 โ€” success ๐ŸŽ‰
  2. 1 โ€” failure ๐Ÿ’€
  3. 64 โ€” partial success ๐Ÿ™ˆ

๐Ÿ“ EXAMPLES ๐Ÿ“

  • chmem --enable 1024 โ€” this command requests 1024 MiB of memory to be set online.
  • chmem -e 2g โ€” this command requests 2 GB of memory to be brought online and, if supported by the architecture, configures the memory beforehand.
  • chmem --disable 0x00000000e4000000-0x00000000f3ffffff โ€” this command takes the memory range from 0x00000000e4000000 to 0x00000000f3ffffff offline and deconfigures it if supported by the architecture.
  • chmem -b -d 10 โ€” this command takes memory block number 10 offline.
  • chmem -b -c 10 -m 1 โ€” this command configures memory block 10 with MEMMAP-ON-MEMORY set. the block must be in a deconfigured state.
  • chmem -b -c 10 โ€” this command configures memory block 10 with the default MEMMAP-ON-MEMORY setting. the default value is displayed in lsmem --output-all. the block must be in a deconfigured state.
  • chmem -b -g 10 โ€” this command deconfigures memory block 10. the block must be offline.
  • chmem -d 5g โ€” this command takes 5 GB of memory offline and deconfigures it if supported by the architecture. blocks that are already offline but still configured are skipped and must be explicitly deconfigured with --deconfigure. ๐Ÿ‘€

๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

lsmem(1)


๐Ÿงš REPORTING BUGS ๐Ÿงš

for bug reports, use the issue tracker <https://github.com/util-linux/util-linux/issues>. please be nice to the devs, they're doing their best. ๐Ÿซถ


โญ AVAILABILITY โญ

the chmem 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!! this is util-linux 2.42.4, dated 2026-09-21, and it's giving CHMEM(8) energy from start to finish. go set some memory online, 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