Skip to main content

VMware Memory Management Part 2 – Transparent Page Sharing (TPS)

This post going to explain detailed view about Transparent Page Sharing. In my Previous post, “VMware Memory Management Part 1 – Understanding ESXi Host Memory States”. I have explained the relation between ESXi host memory states and various memory management techniques.One of the important memory technique which always work towards to save the memory on the host is Transparent Page sharing. Also referred as TPS Which is similar to the storage deduplication technique but it works for memory instead of storage. Transparent page sharing runs by default regardless of ESXi host memory state. TPS will always run on the ESXi host even ESXi memory state is high. Transparent page sharing works with powered on Virtual machines. Transparent page sharing finds all the identical memory pages of the virtual machines running on the host and maps that all identical pages with a single page. ESXi hosts periodically scans the content of guest physical memory for sharing. Let’s consider, When multiple virtual machines are running same guest operating systems and similar applications. Using this transparent page sharing, hypervisor will eliminates the redundant memory pages and maps the identical contents in only one page in the physical memory.  with the use of TPS, Virtual machine memory consumption on the host will get reduced and allows higher level of memory over commitment.
This redundant copies are identified by their contents. TPS runs periodically and it scans all memory pages and calculates the hash value for each of them. Those hash values are saved in the global hash table and which are compared to each other by ESXi kernel. Every time VMkernel finds two identical hashes, It performs bit-by-bit comparison of corresponding memory pages. If pages are same, Kernel leaves only one copy of the page in the memory and removes the second copy. All the requests send to the removed page are redirected to the first single copy. when one of your Virtual machine requests to write to the page, VMkernel creates a new page and new page access will only be provided to that particular virtual machine. This terminology is called Copy-on Write (COW).
Memory Management -Transparent page sharing

Image Thanks to VMware.com
Above diagram is from the VMware’s official Memory Management diagram. It would like to explain using the same image.  3 VM’s (vCenter-vm01,vm02 & vm03) on the esxi host. You can see the  Logical Page number(a,b,d) which are common on all the 3 virtual machines. Using Transparent Page sharing, redundant memory pages (a,b,d) are mapped into single copy at physical memory by removing the redundant copies. You can compare the memory savings  before and after TPS. It uses the Hash table to compare the identical memory pages.
You can verify the memory which are shared using Transparent memory Sharing (TPS) from Esxtop ,Virtual Machine Resource Allocation tab and also using vCenter Performance Graphs.
esxtop -> Press m
You will be able to see how much % of memory is overcommited in your ESXi host using the Value MEM Overcommit avg. The MEM overcommit avg tells us that the average memory over commitment level averages in 1-min, 5-min and 15-min. A value of 0.50 is a 50% over commitment of memory. In our case it is 5.87 which is nothing but 587% memory over commitment on my host. My ESXi host is having 5 GB of memory with 5 Virtual Machines. Out 5, 4 VM’s are allocated with 8 GB and 1 VM alloacted with 2 GB of memory. My total ESXi memory is 5 Gb but allocated memory for Virtual machines is 34 GB. which is almost 7 times the available memory of my ESXi host. This over commitment becomes only possible because of this VMware Memory management techniques.
Detailed stats about Memory saving using Transparent page sharing can be found with PSHARE value. Take a look at PSHARE/MB 2575 MB which is shared between the Virtual machines out of which 355 MB is common. Which allows us to save 2220 MB of memory using Transparent Page sharing.
TPS
Memory which are shared at individual Virtual Machines can also be viewed using the resource allocation tab of each virtual machines. Below Virtual machine is having around shared memory of around 1.64 GB. which is the Amount of guest “physical” memory shared with other virtual machines using the transparent page-sharing mechanism.
TPS_1
You can also use vCenter Performance graphs to collect the Shared memory stats of each Virtual Machine on the ESXi host using the shared stats under Memory in vCenter Advanced chart options.
TPS_2Shared Common is the Amount of machine memory that is shared by all powered-on virtual machines and vSphere services on the host.
shared – sharedcommon = machine memory (host memory) savings (KB)
2575 Mb – 355MB = 2220 MB  host memory saving
TPS_4
Below is the Graph for the Shared Common stats on the ESXi host. This chart can be pulled at ESXi host level using Advanced chart options under Memory.TPS_3I hope this is informative for you. Thanks for Reading!!!. Be Social and share it in social media, If you feel worth share it .

Comments

Popular posts from this blog

Quick Guide to VCF Automation for VCD Administrators

  Quick Guide to VCF Automation for VCD Administrators VMware Cloud Foundation 9 (VCF 9) has been  released  and with it comes brand new Cloud Management Platform –  VCF Automation (VCFA)  which supercedes both Aria Automation and VMware Cloud Director (VCD). This blog post is intended for those people that know VCD quite well and want to understand how is VCFA similar or different to help them quickly orient in the new direction. It should be emphasized that VCFA is a new solution and not just rebranding of an old one. However it reuses a lot of components from its predecessors. The provider part of VCFA called Tenenat Manager is based on VCD code and the UI and APIs will be familiar to VCD admins, while the tenant part inherist a lot from Aria Automation and especially for VCD end-users will look brand new. Deployment and Architecture VCFA is generaly deployed from VCF Operations Fleet Management (former Aria Suite LCM embeded in VCF Ops. Fleet Management...
  Issue with Aria Automation Custom form Multi Value Picker and Data Grid https://knowledge.broadcom.com/external/article?articleNumber=345960 Products VMware Aria Suite Issue/Introduction Symptoms: Getting  error " Expected Type String but was Object ", w hen trying to use Complex Types in MultiValue Picker on the Aria for Automation Custom Form. Environment VMware vRealize Automation 8.x Cause This issue has been identified where the problem appears when a single column Multi Value Picker or Data Grid is used. Resolution This is a known issue. There is a workaround.  Workaround: As a workaround, try adding one empty column in the Multivalue picker without filling the options. So we can add one more column without filling the value which will be hidden(there is a button in the designer page that will hide the column). This way the end user will receive the same view.  
  "Cloud zone insights not available yet, please check after some time" message on Aria Automation https://knowledge.broadcom.com/external/article?articleNumber=314894 Products VMware Aria Suite Issue/Introduction Symptoms: The certificate for Aria operations has been replaced since it was initially added to Aria Automation as an integration. When accessing the Insights pane under  Cloud Assembly  ->  Infrastructure  ->  Cloud Zone  ->  Insights  the following message is displayed:   "Cloud zone insights not available yet, please check after some time." The  /var/log/services-logs/prelude/hcmp-service-app/file-logs/hcmp-service-app.log  file contains ssl errors similar to:   2022-08-25T20:06:43.989Z ERROR hcmp-service [host='hcmp-service-app-xxxxxxx-xxxx' thread='Thread-56' user='' org='<org_id>' trace='<trace_id>' parent='<parent_id>' span='<span_id>'] c.v.a.h.a.common.AlertEnu...