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 usemorM, then<size>is the memory size in MiB (that's1024 x 1024bytes, bestie). if you usegorG, then<size>is the memory size in GiB (which is1024 x 1024 x 1024bytes, 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 thelsmem(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 oflsmem(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--blocksoption. - ZONE โ this is the name of a memory zone, like the output of
lsmem -o +ZONESshows 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,chmemwill set memory online to the zoneMovable, if that's among the valid zones. you can change that default by specifying the--zoneoption with another valid zone. for memory ballooning, it is recommended to select the zoneMovablefor 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--helpoption. ๐ - MEMMAP-ON-MEMORY โ write it as
1or0. a value of1allocates 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 of0stores 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-memoryis valid only with--configure. if you don't specify it, and if it's supported,chmemuses the default value shown inlsmemoutput. ๐ซถ
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--enableand--disableoptions.-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 zoneMovable, if possible.-v,--verboseโ verbose mode. causeschmemto 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:
0โ success ๐1โ failure ๐64โ partial success ๐
๐ EXAMPLES ๐
chmem --enable 1024โ this command requests1024MiB of memory to be set online.chmem -e 2gโ this command requests2GB 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 from0x00000000e4000000to0x00000000f3ffffffoffline and deconfigures it if supported by the architecture.chmem -b -d 10โ this command takes memory block number10offline.chmem -b -c 10 -m 1โ this command configures memory block10with MEMMAP-ON-MEMORY set. the block must be in a deconfigured state.chmem -b -c 10โ this command configures memory block10with the default MEMMAP-ON-MEMORY setting. the default value is displayed inlsmem --output-all. the block must be in a deconfigured state.chmem -b -g 10โ this command deconfigures memory block10. the block must be offline.chmem -d 5gโ this command takes5GB 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 ๐ฅ
๐ง 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