Pcornel
Browse topics
Options
Recent
Favorites
Virtualization · Technical reference

Memory Shares

Direct answer

Memory shares decide which VMs keep their memory when the host runs short: under pressure, VMs with fewer shares are ballooned or swapped first. They do nothing while the host has free memory.

When to use this

Use this when deciding which VMs keep memory when a host runs short.

First 30 seconds

1. Memory shares decide who loses memory under pressure.

2. Only matter during contention.

3. Higher for important VMs.

4. Combine with right-sizing.

5. Monitor reclaim per VM.

Operational verification

pressure → shares → reclaim targets

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • Changing shares without contention, expecting faster VMs.
  • Resource pool shares diluted by many VMs.
  • Ignoring idle memory tax, which reclaims idle memory first.
Platform / version applicability
virtualization
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
Scope / prerequisiteUse this when deciding which VMs keep memory when a host runs short.
What next?2 suggested next steps
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
Key points
  • Shares only act under pressure.
  • Low shares = reclaimed first.
  • Pool shares split among VMs.
Key checks
  • Set-VMMemory <vm> -Priority 80 — Hyper-V memory weight
  • virsh memtune <vm> --soft-limit — libvirt soft limit
  • Get-VMResourceConfiguration (PowerCLI) — vSphere shares
ReferenceWhy it matters1 section · depth on demand

How shares work

Shares only matter when memory is contended. Values are relative (on ESXi: Low 5, Normal 10, High 20 shares per MB of configured memory). A VM with High shares keeps more memory than a Normal one under pressure. In resource pools, shares are divided among the VMs in the pool, so a pool with many VMs can give each VM less than expected.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

Memory shares set priority for reclaiming memory under host pressure: VMs with fewer shares (relative to their size and idle memory) are ballooned or swapped first. VMware also applies an idle memory tax so idle memory is reclaimed before active memory.

In Hyper-V, "Memory weight" with dynamic memory decides which VMs get memory first when demand exceeds supply. Give infrastructure and production VMs higher shares/weight than test VMs.

Example

Host with 64 GB under pressure: VM A (High, 16 GB), VM B (Normal, 16 GB). Memory shares are 20 (High), 10 (Normal) and 5 (Low) per configured MB, so A has 20 × 16,384 = 327,680 shares and B 10 × 16,384 = 163,840. Under contention A gets about twice B's share of the reclaimable memory, after reservations are met and minus idle memory tax on inactive pages.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
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 current

Authoritative/upstream documentation reviewed for bounded claims in Resource Management → Memory Shares. Documentation verification only; this is not observed lab or production Evidence.

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

Confirm action

Continue?