Virtualization Essentials by Matthew Portnoy

Virtualization Essentials by Matthew Portnoy

Author:Matthew Portnoy [Portnoy, Matthew]
Language: eng
Format: epub
ISBN: 9781119267737
Publisher: Wiley
Published: 2016-08-29T00:00:00+00:00


Memory Optimizations

The five virtual machines are allocated 15 GB of memory among them, but in reality they are probably using much less. Application owners routinely ask for more memory than normally required to handle growth and performance spikes. Physical servers, because of the static nature of their configuration, are sized with additional memory for future capacity and potential need. These ingrained practices often find their way into the virtual world as well. The result is that virtual machines often are unnecessarily allocated more memory. The hypervisor has the ability to circumvent that issue. Because the hypervisor controls all of the physical memory operations and the virtual machine's view of those operations, it is simple to tell the virtual machine that it has a certain amount of memory, but then work behind the scenes to make that amount flexible.

Even though a virtual machine is allocated an amount of memory, say 2 GB, the memory is not hard reserved for the VM. The hypervisor can use any of that memory for other virtual machines. The memory allocation is like a high-water mark, and the hypervisor raises and lowers the actual memory amount that is being used. From the guest operating system standpoint, the virtual machine has 2 GB and behaves accordingly. One technique that is used to reclaim memory from the virtual machine is called ballooning. A simple illustration of ballooning memory is shown in Figure 8.5. In order to take the physical memory back from a virtual machine, the pages that are in memory need to be flushed back to a different storage device, in this case, the paging area of the disk. The balloon driver is activated and (virtually) inflates, forcing the operating system to flush pages from memory. The operating system chooses the pages to flush because it knows which pages are the least recently used and are stale, making them good candidates to remove. Once the pages are flushed, the balloon driver deflates, and the hypervisor reclaims the physical memory for use. Usually, this process only happens when there is contention for memory.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.