Use this when hosts swap VM memory to disk and performance collapses.
Swapping
Hypervisor swapping moves VM memory pages to disk when host RAM is exhausted. It is the last and slowest reclaim method, so any sustained host swap-in activity means the host is overcommitted and needs more memory or fewer VMs.
1. Host swapping of VM memory is a severe performance problem.
2. Guest swapping means guest undersized or ballooned.
3. Find which layer is swapping.
4. Add memory or reduce allocations.
5. Use SSD swap only as last resort.
memory shortage → swap → latency
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
esxtopVerification & 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 Checks Verify boundary
esxtop # m: SWCUR, SWR/s
vmstat 1 # KVM host: si/so
Any sustained swap-in rate needs action: free host memory, move VMs or remove limits.
Step 2 Common mistakes Narrow the fault
- Treating host swap as acceptable — any sustained swap-in causes severe latency.
- Swap files on slow storage.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Hypervisor swap is last resort.
- Any sustained swap-in is a problem.
- Swap file location affects speed.
vmstat 1 (si/so)— swap in/outswapon --show— host swapesxtop (SWCUR, SWR/s)— ESXi VM swap
ReferenceWhy it matters1 section · depth on demand
Detecting host swapping
- ESXi:
esxtopmemory viewSWCUR(swapped) andSWR/s(swap reads); any sustained SWR/s is bad. - KVM:
vmstat 1on the host (si/socolumns),/proc/<qemu-pid>/statusVmSwap. - Hyper-V: host paging counters.
Fix by adding host RAM, moving VMs, removing limits or reducing overcommit. Place VM swap files on fast storage if they must exist.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Host swapping writes guest memory to disk without the guest knowing which pages are important — the worst-performing reclaim method. A guest touching a swapped page stalls for disk latency.
esxtop (m): SWCUR, SWR/s, SWW/s
vmstat 5 on KVM host; cat /proc/<qemu-pid>/status | grep VmSwap
Any non-zero host swap-in rate during normal operation is a signal to reduce memory overcommit, add RAM or move VMs. Placing VM swap files on fast SSD reduces, but does not remove, the impact.
Signs per platform
| Platform | Metric |
|---|---|
| ESXi | esxtop m: SWCUR, SWR/s, SWW/s |
| KVM | host vmstat 1 si/so, /proc/<qemu-pid>/status VmSwap |
| Hyper-V | Smart paging file in use (only at VM start) |
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 → Swapping. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://libvirt.org/docs.html · confidence 94%