Pcornel
Browse topics
Options
Recent
Favorites
Virtualization · Technical reference

Memory Virtualization

Direct answer

Memory virtualization maps each VM's guest-physical memory onto host RAM using hardware page tables (EPT/NPT), and lets the host reclaim or overcommit memory with ballooning, page sharing, compression and swapping.

When to use this

Use this when VMs are short of memory, when planning memory overcommit, or when diagnosing ballooning, swapping or NUMA memory locality.

First 30 seconds

1. Memory virtualization maps guest pages to host pages.

2. Reclaim: sharing, ballooning, compression, swap.

3. Size to demand.

4. Watch host pressure.

5. NUMA and huge pages for performance.

Operational verification

guest page → SLAT → host page

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • Large memory overcommit without monitoring ballooning and swapping.
  • Ballooning drivers missing in guests, so hosts jump straight to swapping.
  • VMs larger than one NUMA node's memory without vNUMA.
  • Memory limits left from templates.
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
Scope / prerequisiteUse this when VMs are short of memory, when planning memory overcommit, or when diagnosing ballooning, swapping or NUMA…
What next?2 suggested next steps
Child topics (this level)10
Evidence1
On this pageJump to a specific section
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
Drill down

Subtopics

Go one level deeper into this subject.

Subtopic Guest Memory

Guest memory is the RAM configured for a VM and seen by its OS.

Subtopic Host Memory

Host memory is the physical RAM of the hypervisor host, shared between the hypervisor, VM overhead and every VM's guest memory.

Subtopic Memory Overcommit

Memory overcommit assigns more RAM to VMs than the host physically has, relying on unused memory, page sharing and ballooning.

Subtopic Ballooning

Ballooning lets the hypervisor reclaim memory through a driver inside the guest (vmmemctl, virtio-balloon, Hyper-V Dynamic Memory) that inflates and hands unused guest pages back to the host under memory pressure.

Subtopic Memory Sharing

Memory sharing (Transparent Page Sharing on ESXi, KSM on KVM) deduplicates identical memory pages across VMs.

Subtopic Swapping

Hypervisor swapping moves VM memory pages to disk when host RAM is exhausted.

Subtopic Huge Pages

Huge pages back VM memory with 2 MB or 1 GB pages instead of 4 KB, reducing TLB misses and page-table overhead for large or latency-sensitive VMs.

Subtopic NUMA

Memory NUMA placement keeps a VM's memory on the same NUMA node as the cores running its vCPUs.

Subtopic Memory Pressure

Memory pressure is the state where VM demand approaches host RAM, so the host starts reclaiming with ballooning, compression and swapping.

Subtopic 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.

Key points
  • Consumed host memory ≠ active guest memory.
  • Ballooning means host pressure, not a guest problem.
  • Host swapping is the slowest reclaim — treat it as an incident.
Key checks
  • virsh dommemstat <vm> — VM memory stats
  • free -h — host memory
  • esxtop (m) — ESXi memory
ReferenceWhy it matters1 section · depth on demand

Memory techniques overview

TechniquePurpose
EPT/NPTHardware translation of guest to host memory
Large/huge pagesFewer TLB misses
Page sharing (TPS/KSM)Deduplicate identical pages
BallooningReclaim unused guest memory
CompressionCompress pages before swapping
Host swappingLast resort, very slow
NUMA placementKeep memory local to the vCPUs
ReferenceHow it works1 section · depth on demand

In depth

Memory virtualization gives each VM its own guest-physical address space mapped to host memory through EPT/NPT. The hypervisor can back that memory fully up front, lazily on first touch, share identical pages between VMs, reclaim through ballooning or, as a last resort, swap to disk.

Key metrics: configured vs active (touched recently) vs consumed (host memory backing it), balloon size, swapped memory, and host free memory. Healthy hosts show no host swapping and little or no ballooning.

ReferenceImportant terms & boundaries1 section · depth on demand
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. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://libvirt.org/docs.html · confidence 94%
Confirmation

Confirm action

Continue?