Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

8.3.2. Memory Tuning with virsh memtune

The optional <memtune> element in the guest XML configuration allows administrators to configure guest virtual machine memory settings manually. If <memtune> is omitted, default memory settings apply.
Display or set memory parameters in the <memtune> element in a virtual machine with the virsh memtune command, replacing values according to your environment:
virsh # memtune virtual_machine --parameter size
Available parameters include:
The maximum memory the virtual machine can use, in kibibytes (blocks of 1024 bytes).


Setting this limit too low can result in the virtual machine being killed by the kernel.
The memory limit to enforce during memory contention, in kibibytes (blocks of 1024 bytes).
The maximum memory plus swap the virtual machine can use, in kibibytes (blocks of 1024 bytes). The swap-hard-limit value must be more than the hard-limit value.
The guaranteed minimum memory allocation for the virtual machine, in kibibytes (blocks of 1024 bytes).


See # virsh help memtune for more information on using the virsh # memtune command.