Use this as the start point for VM memory problems: slow VMs, paging, ballooning or host swapping.
Memory Troubleshooting
Troubleshoot VM memory by checking guest usage and paging inside the VM, then host-side ballooning, compression, swap-in rates and NUMA locality; host swapping or high balloon size points to overcommit rather than a guest problem.
1. Compare guest and host views.
2. Check ballooning, swap, OOM.
3. Check memory limits/reservations.
4. Check NUMA locality.
5. Right-size and rebalance.
guest usage → host allocation → reclaim → symptoms
Context & applicabilityCommon mistakes · platform/version boundaries
- Adding RAM to a VM while the host is the bottleneck.
- Missing memory limits or reservations that cap VMs.
- Ignoring application caches (Java heap, SQL Server) that grow to fill memory.
Operational reference
Fast context before you go deeper.
virsh dommemstat <vm>Primary Commands
Configuration and operational commands for this Topic.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Troubleshooting order Narrow the fault
1. Inside the guest: is the application or OS paging? (free -m, vmstat 1, Performance Monitor).
2. On the host: ballooning, compression, swap-in rate for this VM.
3. Limits or reservations that cap the VM below its configured size.
4. Host totals and other VMs competing for memory.
5. NUMA: a VM larger than one NUMA node, or memory placed remotely.
Fix the first layer that shows a problem: more guest RAM, remove a limit, move VMs, or add host memory.
- Guest problem or host problem — find out first.
- Host swap = urgent.
- Limits are a common hidden cause.
virsh dommemstat <vm>— VM memory detailfree -h; vmstat 1— host memory and swapdmesg | grep -i -e oom -e 'out of memory'— OOM events
ReferenceHow it works1 section · depth on demand
Method
| Symptom | Check |
|---|---|
| VM slow, guest shows free memory | Host ballooning/swapping (MCTLSZ, SWCUR) |
| Guest swapping | VM too small: working set > configured |
| VM won't start (insufficient memory) | Host free memory, reservations, HA admission control |
| OOM killer in guest | Guest memory, balloon minimum too low |
| Host memory full after adding ZFS/Ceph | ARC/OSD memory not budgeted |
esxtop (m), sort by MCTLSZ / SWCUR
virsh dommemstat vm1
journalctl -k | grep -i 'out of memory'
ReferenceConfiguration & state1 section · depth on demand
Useful commands
esxtop # m: MCTLSZ, SWCUR, SWR/s, ZIP/s
virsh dommemstat vm01
vmstat 1 (in guest: si/so)
Get-Counter '\Memory\Pages/sec','\Memory\Available MBytes'
Sustained si/so > 0 in a Linux guest or high Pages/sec with low Available MBytes on Windows means the guest itself needs more memory.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Memory Virtualization → Memory Troubleshooting. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://libvirt.org/docs.html · confidence 94%