Use of large pages can cause memory to be fully allocated
search cancel

Use of large pages can cause memory to be fully allocated

book

Article ID: 330830

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

This article provides information about how the use of large pages can cause memory to be fully allocated.

Environment

VMware ESXi 4.1.x Embedded
VMware vSphere ESXi 5.1
VMware ESXi 4.0.x Embedded
VMware vSphere ESXi 5.0
VMware ESXi 4.0.x Installable
VMware ESX 4.0.x
VMware ESXi 4.1.x Installable
VMware vCenter Server 4.0.x
VMware ESX 4.1.x

Resolution

Large pages are crucial for performance when using hardware-assisted MMU. In such cases, ESXi/ESX backs the guest physical address space with 2 MB pages whenever possible. Even if the guest is accessing a 4 KB page in its physical address space, ESXi/ESX might allocate 2 MB of memory to back the 2 MB region that contains the 4 KB page.

Because the use of large pages commits 2 MB of memory at a time, this policy can cause memory to be allocated to a virtual machine more quickly than if large pages are not used. If the guest sparsely accesses memory in its physical address space, such a virtual machine may have more memory allocated to it than it needs. Moreover, if a 2 MB region of guest memory is backed with a large page, the constituent 4 KB pages cannot be page shared. This results in lower memory savings via page sharing in an under-committed system. However, the performance benefits of large pages for the MMU and TLB remain. In addition, if memory becomes over-committed on the system, the VMkernel and VMM can break large pages as necessary and reclaim memory by sharing pages, by ballooning, or by swapping. So while this policy might cause more of the host's available memory to be allocated than would be the case if large pages were not used, it should cause neither performance nor scheduling problems for the virtual machines that use it.

Example

If a software application accesses a sequence of single 4 KB pages that have a stride of 2 MB (512 pages), each 2 MB region can be backed by a 2 MB large page even though only one 4 KB page in each of those 2 MB regions is needed. The remaining 511 pages in that 2 MB region are backed even though they are never accessed.

Capacity Planning

Capacity planning requires a thorough understanding of the average and the peak memory demands of each virtual machine and resource pool as well as the implications of their reservation, limit, and share settings. The risk and reward of performance and memory overcommitment also must be closely considered.

You should base your capacity planning decisions on the examination of multiple memory performance metrics and not the host memory usage metric alone.

For more information, see:

Additional Information

To be alerted when this article is updated, click Subscribe to Document in the Actions box.