6.7

Table Of Contents
Sharing Memory Across Virtual Machines
Many ESXi workloads present opportunities for sharing memory across virtual machines (as well as within
a single virtual machine).
ESXi memory sharing runs as a background activity that scans for sharing opportunities over time. The
amount of memory saved varies over time. For a fairly constant workload, the amount generally increases
slowly until all sharing opportunities are exploited.
To determine the effectiveness of memory sharing for a given workload, try running the workload, and use
resxtop or esxtop to observe the actual savings. Find the information in the PSHARE field of the
interactive mode in the Memory page.
Use the Mem.ShareScanTime and Mem.ShareScanGHz advanced settings to control the rate at which the
system scans memory to identify opportunities for sharing memory.
You can also configure sharing for individual virtual machines by setting the sched.mem.pshare.enable
option.
Due to security concerns, inter-virtual machine transparent page sharing is disabled by default and page
sharing is being restricted to intra-virtual machine memory sharing. This means page sharing does not
occur across virtual machines and only occurs inside of a virtual machine. The concept of salting has
been introduced to help address concerns system administrators may have over the security implications
of transparent page sharing. Salting can be used to allow more granular management of the virtual
machines participating in transparent page sharing than was previously possible. With the new salting
settings, virtual machines can share pages only if the salt value and contents of the pages are identical. A
new host config option Mem.ShareForceSalting can be configured to enable or disable salting.
See Chapter 16 Advanced Attributes for information on how to set advanced options.
Memory Compression
ESXi provides a memory compression cache to improve virtual machine performance when you use
memory overcommitment. Memory compression is enabled by default. When a host's memory becomes
overcommitted, ESXi compresses virtual pages and stores them in memory.
Because accessing compressed memory is faster than accessing memory that is swapped to disk,
memory compression in ESXi allows you to overcommit memory without significantly hindering
performance. When a virtual page needs to be swapped, ESXi first attempts to compress the page.
Pages that can be compressed to 2 KB or smaller are stored in the virtual machine's compression cache,
increasing the capacity of the host.
You can set the maximum size for the compression cache and disable memory compression using the
Advanced Settings dialog box in the vSphere Client.
vSphere Resource Management
VMware, Inc. 42