LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

chmem

configure memory hotplug state

TLDR

Set a memory block offline
$ sudo chmem -b -d [block_number]
copy
Set a memory block online
$ sudo chmem -b -e [block_number]
copy
Set a memory range offline
$ sudo chmem -d 0x[start_address]-0x[end_address]
copy
Set a memory range online
$ sudo chmem -e 0x[start_address]-0x[end_address]
copy
Set memory online in a specific zone
$ sudo chmem -e 0x[start_address] -z [Movable]
copy

SYNOPSIS

chmem [options] size|range|block

DESCRIPTION

chmem modifies the state of memory blocks in a Linux system, bringing them online or offline. This is primarily used in virtualized environments for memory hotplug operations.Memory blocks are chunks of physical memory that can be individually managed. The tool allows dynamic memory management without rebooting.

PARAMETERS

-b, --block

Operate on memory blocks by block number
-d, --disable
Set memory offline
-e, --enable
Set memory online
-z, --zone zone
Assign memory to a specific zone (DMA, DMA32, Normal, Movable)
-h, --help
Display help

INSTALL

sudo apt install util-linux
copy
sudo dnf install util-linux
copy
sudo pacman -S util-linux
copy
sudo apk add util-linux-misc
copy
sudo zypper install util-linux
copy
brew install util-linux
copy
nix profile install nixpkgs#util-linux
copy

CAVEATS

Requires root privileges. Not all systems support memory hotplug. Memory containing kernel data or in-use pages cannot be offlined. Virtual machines may require specific configuration to support memory hotplug.

SEE ALSO

lsmem(1), free(1)

Copied to clipboard
Kai