Pcornel
Virtualization · Memory Virtualization

Memory Sharing

Cheat sheet · https://pcornel.dk/topic.php?topic=3493

Back to the Topic

Answer

Memory sharing (Transparent Page Sharing on ESXi, KSM on KVM) deduplicates identical memory pages across VMs. It saves RAM for similar guests but is limited by default today because of side-channel security concerns.

Remember

  • Sharing saves RAM for similar guests.
  • Inter-VM sharing is limited for security.
  • Large pages reduce sharing.

First checks

  • cat /sys/kernel/mm/ksm/pages_sharing — KSM shared pages
  • systemctl status ksmtuned — KSM tuner
  • esxtop — SHRD (TPS)

Verify in this order

identical pages → merged → copy on write

Where it usually breaks

First mismatch in host capability/IOMMU/NUMA → hypervisor allocation/mapping → virtual hardware model → guest driver/enumeration → workload use; preserve identity/native error/pre-state before mutation.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=3493

Confirmation

Confirm action

Continue?