
Virtual CPU and Memory Concepts
Learner Objectives
After completing this lesson, you should be able to meet the following objectives:
- Describe CPU and memory concepts in relation to a virtualized environment
- Recognize techniques for addressing memory resource overcommitment
- Identify additional technologies that improve memory usage
- Describe how VMware Virtual SMP works
- Explain how the VMkernel uses hyperthreading
Memory Virtualization Basics
vSphere has the following layers of memory:
- Guest OS virtual memory is presented to applications by the operating system.
- Guest OS physical memory is presented to the virtual machine by the VMkernel.
- Host machine memory that is managed by the VMkernel provides a contiguous, addressable memory space that is used by the VM.
VM Memory Overcommitment
Memory is overcommitted when the combined configured memory footprint of all powered-on VMs exceeds that of the host memory sizes. When memory is overcommitted:
- VMs do not always use their full allocated memory.
- To improve memory usage, an ESXi host transfers memory from idle VMs to VMs that need more memory.
- Overcommitted memory is stored in the .vswp file.
- Memory overhead is stored in the vmx*.vswp file.
Memory Overcommit Techniques
An ESXi host uses memory overcommit techniques to allow the overcommitment of memory while possibly avoiding the need to page memory out to disk.
Methods Used by the ESXi Host | Details |
Transparent page sharing | This method economizes the use of physical memory pages. In this method, pages with identical contents are stored only once. |
Ballooning | This method uses the VMware Tools balloon driver to deallocate memory from one VM to another. The ballooning mechanism becomes active when memory is scarce, forcing VMs to use their own paging areas. |
Memory compression | This method tries to reclaim some memory performance when memory contention is high. |
Host-level SSD swapping | Use of a solid-state drive on the ESXi host for a host cache swap file might increase performance. |
VM memory paging to disk | Using VMkernel swap space is the last resort because of poor performance. |
Configuring Multicore VMs
You can build VMs with multiple virtual CPUs (vCPUs). The number of vCPUs that you configure for a single VM depends on the physical architecture of the ESXi host.
About Hyperthreading
With hyperthreading, a core can execute two threads or sets of instructions at the same time.
- Hyperthreading provides more scheduler throughput.
- Hyperthreading is enabled by default. To enable hyperthreading:
- Verify that the host system supports hyperthreading.
- Enable hyperthreading in the system BIOS.
- Ensure that hyperthreading for the ESXi host is turned on.
CPU Load Balancing
The VMkernel balances processor time to guarantee that the load is spread smoothly across processor cores in the system.
Review of Learner Objectives
After completing this Virtual CPU and Memory Concepts lesson, you should be able to meet the following objectives:
- Describe CPU and memory concepts in relation to a virtualized environment
- Recognize techniques for addressing memory resource overcommitment
- Identify additional technologies that improve memory usage
- Describe how VMware Virtual SMP works
- Explain how the VMkernel uses hyperthreading