Information Center

What is the difference between memory sharing and overuse?

  

Both sharing and overcommitment memory management technologies can help improve system integration, but before using them, administrators should first understand the subtle differences between the two.

The number of virtual machines that a server can support usually depends on the available computing resources that the physical hardware can provide. Most resources, such as processor cycles, storage I/O, and network bandwidth, can be shared relatively simply. The principle of this approach is that the load is not always busy, so sharing - or overusing - resources can achieve a higher level of load consolidation, so the total amount of resources allocated to virtual machines can exceed the current total amount of physical resources; Even if problems occur under special circumstances, they only have a slight impact on load performance.

However, server memory has always been regarded as a fixed resource. Since each virtual machine running in memory is a complete image of the application and data set, it is very important to provide sufficient memory resources for all virtual machines. Otherwise, the server will have to use the swap file on the hard disk to supplement the memory space -- but this usually has a very serious impact on the performance of the virtual machine. But with the overuse of memory and the emergence of memory sharing technology, this situation is changing.

With memory overuse technology, the amount of memory allocated by the host server can exceed the amount of existing physical memory. For example, if a host server has 4GB of physical memory, six virtual machines with 1GB of memory may be created with the help of memory overuse technology. At first glance, this is a very dangerous way, because two kinds of loads cannot share different pieces of data in the same memory address space at the same time - at least not until the data is exchanged to the hard disk.

However, the designer soon realized that many virtual machines would not use all the memory space allocated for them, resulting in a waste of some memory space because they were always free or unused. The hypervisor can find the free memory and provide it to the virtual machine to be used. If no other virtual machine needs additional memory, the free space can be used to create a new virtual machine. The priority of the virtual machine in the memory pool can be defined in the "Shares" virtual memory configuration, and the minimum memory space that the virtual machine can use can also be defined through the "Reservation" mechanism to ensure that the virtual machine has enough memory to run normally.

Virtual machines can also share large amounts of content. For example, the six 1GB memory virtual machines mentioned above all run Windows Server 2012 R2, and two of them run the same business applications. In this case, five Windows Server 2012 R2 and one application are redundant. Memory sharing technology allows different virtual machines to use a common instance of the same memory page. This can reduce the total amount of memory that the virtual machine needs to use, and support higher levels of overuse. The implementation of memory sharing technology is very similar to the data de duplication mechanism in hard disk storage.

It should be noted that memory overuse and memory sharing are highly dynamic technologies, which will be affected by the total computing load and the amount of common content. For example, rarely used virtual machines can free up a lot of memory space for memory overuse. However, with the increase of virtual machine usage frequency and memory demand, the hypervisor must return these memory to the virtual machine, otherwise it will face performance problems caused by using hard disks to exchange files. Similarly, virtual machines that use different operating system versions, applications, and data may have few common memory pages that can be shared. Virtual machine migration and load balancing will change the general memory page and affect memory sharing.