6.5.1

Table Of Contents
virtual machine often consumes less memory than it might when running on physical machines. As a result,
higher levels of overcommitment can be supported eciently. The amount of memory saved by memory
sharing depends on whether the workload consists of nearly identical machines which might free up more
memory. A more diverse workload might result in a lower percentage of memory savings.
N 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. Page sharing does not occur
across virtual machines and only occurs inside a virtual machine. See “Sharing Memory Across Virtual
Machines,” on page 40 for more information.
Types of Memory Virtualization
There are two types of memory virtualization: Software-based and hardware-assisted memory
virtualization.
Because of the extra level of memory mapping introduced by virtualization, ESXi can eectively manage
memory across all virtual machines. Some of the physical memory of a virtual machine might be mapped to
shared pages or to pages that are unmapped, or swapped out.
A host performs virtual memory management without the knowledge of the guest operating system and
without interfering with the guest operating system’s own memory management subsystem.
The VMM for each virtual machine maintains a mapping from the guest operating system's physical
memory pages to the physical memory pages on the underlying machine. (VMware refers to the underlying
host physical pages as “machine” pages and the guest operating system’s physical pages as “physical”
pages.)
Each virtual machine sees a contiguous, zero-based, addressable physical memory space. The underlying
machine memory on the server used by each virtual machine is not necessarily contiguous.
For both software-based and hardware-assisted memory virtualization, the guest virtual to guest physical
addresses are managed by the guest operating system. The hypervisor is only responsible for translating the
guest physical addresses to machine addresses. Software-based memory virtualization combines the guest's
virtual to machine addresses in software and saves them in the shadow page tables managed by the
hypervisor. Hardware-assisted memory virtualization utilizes the hardware facility to generate the
combined mappings with the guest's page tables and the nested page tables maintained by the hypervisor.
The diagram illustrates the ESXi implementation of memory virtualization.
Figure 51. ESXi Memory Mapping
virtual machine
1
guest virtual memory
guest physical memory
machine memory
a b
a
a b b c
b
c b
b c
virtual machine
2
n
The boxes represent pages, and the arrows show the dierent memory mappings.
n
The arrows from guest virtual memory to guest physical memory show the mapping maintained by the
page tables in the guest operating system. (The mapping from virtual memory to linear memory for
x86-architecture processors is not shown.)
n
The arrows from guest physical memory to machine memory show the mapping maintained by the
VMM.
Chapter 5 Memory Virtualization Basics
VMware, Inc. 29