- vSphere High Performance Cookbook(Second Edition)
- Kevin Elder Christopher Kusek Prasenjit Sarkar
- 432字
- 2021-07-02 20:59:56
Memory ballooning
Memory ballooning tells the guest operating system that it does not have enough memory from the host so that the guest operating system could free some of its memory. When there is a memory crisis, the hypervisor tells the balloon driver to request some number of megabytes from the guest operating system. The hypervisor knows that pages occupied by the balloon driver will never store data, so the pages of pRAM requested by the balloon driver can then be reallocated safely to other VMs. It is the guest operating system's call to decide which pages of vRAM it should allocate to the balloon driver, and it will start with free pages. If it has plenty of free or idle guest physical memory, inflating the balloon will induce no guest-level paging and thus it will not affect guest performance. However, in the case of memory contention within the guest, the VM OS decides which guest physical pages are to be paged out to the virtual swap device in order to satisfy the balloon driver's allocation requests.
The balloon driver reclaims the guest operating system's allocated memory using Idle Memory Tax (IMT). IMT may reclaim up to 75 percent of idle memory. A guest operating system page file is necessary in order to prevent guest operating system kernel starvation. The vmmemctl driver should aggressively reclaim memory due to severe host contention (make sure that the guest operating system page file is at least 65 percent of the configured vRAM). Even here, the guest operating system can make intelligent guesses about which pages of data are least likely to be requested in future. (You'll see this in contrast with hypervisor-level swapping, which is discussed next.) Look at the following pictorial representation of memory page mapping to host memory:

Host-level swapping in ESXi is not sufficient to reclaim memory during TPS and ballooning. To support this, when you start a VM, the hypervisor creates a separate swap file for the VM. This is primarily because if it frees pRAM for other VMs, the hypervisor can directly swap out vRAM with the swap file.
Swapping is a guaranteed technique to reclaim a specific amount of memory within a specific amount of time. However, you should be concerned about host-level swapping because it can severely penalize guest performance. This occurs when the hypervisor has no knowledge about which guest physical pages should be swapped, and the swapping might cause unintended interactions with the native memory management policies in the guest operating system. The following is a pictorial representation of host-level memory page swapping:

- JavaScript從入門到精通(微視頻精編版)
- 精通Nginx(第2版)
- 國際大學(xué)生程序設(shè)計(jì)競(jìng)賽中山大學(xué)內(nèi)部選拔真題解(二)
- 小程序?qū)崙?zhàn)視頻課:微信小程序開發(fā)全案精講
- Cross-platform Desktop Application Development:Electron,Node,NW.js,and React
- 我的第一本算法書
- Oracle JDeveloper 11gR2 Cookbook
- MongoDB權(quán)威指南(第3版)
- Nginx Lua開發(fā)實(shí)戰(zhàn)
- Terraform:多云、混合云環(huán)境下實(shí)現(xiàn)基礎(chǔ)設(shè)施即代碼(第2版)
- The Professional ScrumMaster’s Handbook
- ASP.NET 4.0 Web程序設(shè)計(jì)
- Drupal 8 Development Cookbook(Second Edition)
- Python物理建模初學(xué)者指南(第2版)
- 你好!Java