Memory Limits
Cheat sheet · https://pcornel.dk/topic.php?topic=3615
Answer
A memory limit caps the physical RAM a VM can use below its configured size; anything above the limit is ballooned or swapped even if the host has free memory. It is a common hidden cause of slow VMs.
Remember
- Remove memory limits unless there is a documented reason.
First checks
virsh setmem / virsh memtune <vm> --hard-limit— libvirt hard limitSet-VMMemory <vm> -MaximumBytes 8GB— Hyper-V dynamic maxGet-VMResourceConfiguration (PowerCLI)— vSphere memory limit
Verify in this order
configured memory → limit → reclaim
Where it usually breaks
First mismatch in management intent → host/cluster capability → hypervisor runtime/task → virtual resource/device → guest state → workload-visible read-back; preserve identity/native error/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3615