Pcornel
Browse topics
Options
Recent
Favorites
Virtualization · Technical reference

Swapping

Direct answer

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.

When to use this

Use this when hosts swap VM memory to disk and performance collapses.

First 30 seconds

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.

Operational verification

memory shortage → swap → latency

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
virtualization-hardware
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformvirtualization-hardware
Key commandesxtop
Scope / prerequisiteUse this when hosts swap VM memory to disk and performance collapses.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Key points
  • Hypervisor swap is last resort.
  • Any sustained swap-in is a problem.
  • Swap file location affects speed.
Key checks
  • vmstat 1 (si/so) — swap in/out
  • swapon --show — host swap
  • esxtop (SWCUR, SWR/s) — ESXi VM swap
ReferenceWhy it matters1 section · depth on demand

Detecting host swapping

  • ESXi: esxtop memory view SWCUR (swapped) and SWR/s (swap reads); any sustained SWR/s is bad.
  • KVM: vmstat 1 on the host (si/so columns), /proc/<qemu-pid>/status VmSwap.
  • 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.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docvirtualization-hardware current

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%
Confirmation

Confirm action

Continue?