VMware’s vSphere virtualization hypervisor, also known as ESXi or simply vSphere, allows us to create multiple virtual machines on the same physical machine. ESXi allows virtual machines to use less than 100% of their allocated memory. This is because ESXi can be used to overcommit memory on the physical host, also known as the server.
What happens if you allocate more memory for virtual machines than the host server has? And your virtual machines attempt to use all of it? This is exactly what ESXi’s intelligent, memory management system does. Let’s take a look at four memory management techniques, and what they address.
1. Transparent page sharing is enabled by default
TPS, or Transparent Page Sharing, is one of the most impactful memory management options in ESXi. TPS, or Transparent Page Sharing, works by default. It looks inside a virtual machine’s RAM and finds duplicate memory pages. If the blocks of memory are identical, they can be reclaimed on the physical server and used by other virtual machines. This option is available in recent versions of ESXi by default.
VMware also offers Inter-VM TPS, which will deduplicate memory pages between virtual machines running on the same ESXi hosts. This is especially useful when multiple operating systems are running on the same ESXi hosts. This is because different operating systems may use the same memory pattern, which could be many gigabytes. This can be done by deduplicating the memory to one copy on the host, which can save significant amounts of memory.
Learn how to become a security expert with SPOTO’s Cybersecurity Training
Start training This is due VMware’s strict security policies regarding the sharing of virtual hardware among virtual machines. To prevent an attack on more than one VM, it is important to isolate them all.
2. Memory ballooning is mostly non-disruptive
Memory ballooning is the most popular memory reclaim method. Virtual machines are not disrupted by ballooning. Ballooning can be used to return memory that has been used in virtual machines to the host to use in other machines.
For memory ballooning to work, VMware tools must be installed. If a host runs out of memory, it will search virtual machines that have memory that is “free”, but has not been released to it. Each virtual machine has a balloon driver that inflates and attempts to squeeze memory out like a balloon. This is done to give “free” memory to the host. The host will determine how much memory has been recovered and allow the host use it for other virtual machines in the hope that this is enough memory available to solve the host’s low memory issue.
Ballooning is not considered disruptive, but if your host experiences constant ballooning, you will want to fix it permanently by increasing the memory or moving virtual machines to another host with enough memory.
3. Memory compression can save small amounts of memory
If ballooning and TPS don’t free enough memory for the host then compression begins on the virtual machine’s memory. Although TPS and ballooning are generally not disruptive, compression can have a significant performance impact. This is why compression is the last option the host has to recover memory.
If memory pages can compress, the host will attempt to do this and store them in a special cache. After the cache is full, compressed pages must be switched with other pages before more memory can become available.
Compression can reduce the performance of virtual machines and their workloads. It is important to balance virtual machines between hosts.