Use this when checking how much physical RAM a host has left for VMs and overhead.
Host Memory
Host memory is the physical RAM of the hypervisor host, shared between the hypervisor, VM overhead and every VM's guest memory. When it runs short the host reclaims memory by sharing, ballooning, compression or swapping.
1. Host memory backs all VMs plus host overhead.
2. Keep reserve for host and hypervisor.
3. Host swapping is very bad.
4. Monitor available.
5. Plan for N+1 failover.
physical RAM → host reserve + VM allocations
Context & applicabilityCommon mistakes · platform/version boundaries
- Forgetting ZFS ARC or Ceph OSD memory on hyperconverged hosts.
- Running hosts at 95 % memory with no failover headroom.
- Uneven DIMM population reducing bandwidth.
Operational reference
Fast context before you go deeper.
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 Checks Verify boundary
| Platform | Command |
|---|---|
| ESXi | esxtop → m (MEMSZ, GRANT, SWCUR, MCTLSZ) |
| Proxmox/KVM | free -h, arc_summary (ZFS ARC), cat /proc/meminfo |
| Hyper-V | Get-VMHost | Select MemoryCapacity, Get-VM | Select Name,MemoryAssigned |
On Proxmox with ZFS, cap the ARC (zfs_arc_max) so it does not compete with VMs.
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.
- Host needs memory for itself and VM overhead.
- Low free memory triggers reclaim.
- Failover needs spare memory on other hosts.
free -h— host total/availablevirsh nodememstats— libvirt host memoryGet-VMHost | fl MemoryCapacity; Get-Counter '\Memory\Available MBytes'— Hyper-V host
ReferenceWhy it matters1 section · depth on demand
What uses host memory
| Consumer | Notes |
|---|---|
| Hypervisor | A few GB for the kernel and services |
| Per-VM overhead | Grows with vCPUs and configured RAM |
| Guest memory | Sum of active VM memory |
| Storage/caching | For example ZFS ARC on Proxmox, vSAN |
| Failover reserve | Room to restart VMs from a failed host |
Plan so that, after one host fails, the remaining hosts still fit all VMs without swapping.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Where host memory goes on a virtualisation node
root@pve1:~# free -g
total used free shared buff/cache available
Mem: 503 431 12 1 60 66
root@pve1:~# arc_summary -s arc | grep -E 'ARC size|Max size' # if ZFS is used
root@pve1:~# cat /sys/kernel/mm/ksm/pages_sharing
| Consumer | How to see it |
|---|---|
| VMs (QEMU RSS) | ps -eo rss,cmd --sort=-rss \| grep kvm \| head |
| ZFS ARC | arc_summary, /proc/spl/kstat/zfs/arcstats |
| Ceph OSDs | ceph daemon osd.N dump_mempools, osd_memory_target |
| Huge pages | grep Huge /proc/meminfo (reserved, counted as used) |
| Page cache | buff/cache — reclaimable |
Mechanisms and when they act
The Proxmox VM chapter describes the balloon device and automatic memory allocation with a Shares weight: when host memory gets tight, VMs with ballooning enabled are asked to give memory back, down to their configured minimum.
| Mechanism | Acts when | Cost |
|---|---|---|
| Ballooning | Host memory under pressure | Guest may start swapping |
KSM (ksmtuned) | Host memory usage high | CPU for page scanning |
| Host swap | RAM exhausted | Severe latency for affected VMs |
| OOM killer | Nothing else helps | Kills the largest process — usually a VM |
OOM: recognise it
journalctl -k | grep -i -E 'out of memory|oom-kill'
Out of memory: Killed process 31244 (kvm) total-vm:17394236kB, anon-rss:16771232kB
A VM that "stopped by itself" with this message was killed by the host kernel. Fix capacity or limits; restarting it without change invites a repeat.
Keep headroom
Leave roughly 10–15 % of host RAM unallocated after guests, ARC and storage daemons, and cap ZFS ARC explicitly on nodes that run many VMs (zfs_arc_max in /etc/modprobe.d/zfs.conf). Memory pressure on one node also blocks live migrations to it, which removes your escape route during incidents.
*The host RAM readings and OOM-killer log entry above are illustrative examples, not captured from a lab or production host.*
Worked example
Host memory must cover VM memory actually backed, hypervisor overhead and host services (ZFS ARC, Ceph OSDs, management agents).
Worked example (Proxmox with ZFS and Ceph): 512 GB host − 16 GB ARC cap − 8 × 5 GB for OSDs − 8 GB host OS = ~448 GB available to VMs. Planning VMs to 448 GB with no ballooning margin leaves no room; keep 10 % free for spikes.
free -g; arc_summary | head; ceph daemon osd.0 dump_mempools | head
esxcli hardware memory get; esxtop (m) PMEM/MB
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 → Host Memory. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://libvirt.org/docs.html · confidence 94%