In this blog post we will discuss some crucial information related to memory which can be monitored using vSphere client.
One of the major factor which affects a VM performance is the amount of memory which is allocated to it, and you all knew it.
Let’s assume this situation. You need to setup SQLServer on a virtual environment and you requested your VMware admin to allocate 3GB of memory for the VM guest. [3 GB is so low a number these days, but this is just for an explanation]
The VMware admin sets up the guest and confirm that it has got 3 GB of memory.
Do you really think that this whole 3GB is dedicated for this VM ?
To understand the concepts really clear, we will need to see the VMware guest memory allocation numbers, this view is available under the resource allocation tab after choosing the VM –
So what all are these numbers? Private, Shared, Ballooned !!!
Let’s look at the definition of each of them –
Note – I have read extensively to understand how memory management is done by the hypervisor and have given proper credits & references FOR all the information which is mentioned in this blog post.
|Active Guest Memory||Amount of memory recently accessed.|
|Private Guest Memory||Amount of memory backed by host memory and not being shared.|
|Shared Guest Memory||Amount of the virtual machine’s memory being shared.|
|Ballooned Guest Memory||Amount of the virtual machine’s memory reclaimed by ballooning.|
|Compressed Guest Memory||Amount of the virtual machine’s memory in compression cache.|
|Swapped Guest Memory||Amount of the virtual machine’s memory reclaimed by swapping.|
|Unaccessed Guest Memory||Amount of the virtual machine’s memory never referenced by the guest.|
In the above figure Active memory is 368 MB. Active Guest Memory is defined as the amount of guest memory that is currently being used by the guest operating system and its applications.
Private memory is configured memory – shared memory , ie 3072 MB – 692 MB = 2380 MB (2.32 GB)
This amount of memory is can be definitely utilized by the VM and nothing shares it.
Shared memory this is the amount of memory shared by TPS (Transparent page sharing).
The best explanation I could ever find for TPS is from this VMware white paper http://www.vmware.com/files/pdf/perf-vsphere-memory_management.pdf
” When multiple virtual machines are running, some of them may have identical sets of memory content. This presents opportunities for sharing memory across virtual machines (as well as sharing within a single virtual machine). For example, several virtual machines may be running the same guest operating system, have the same applications, or contain the same user data. With page sharing,the hypervisor can reclaim the redundant copies and only keep one copy, which is shared by multiple virtual machines in the host physical memory. As a result, the total virtual machine host memory consumption is reduced and a higher level of memory over commitment is possible.”
Ballooned memory This should be zero ideally. Ballooning is a memory reclaim process and it’s done by the balloon driver which is installed on the guest. When ever the host memory is low, the balloon driver will reclaim memory from guest for the host.
Compressed memory This should again be zero ideally. When a virtual page has exhausted transparent page sharing and ballooning it must be swapped to disk. Starting vSphere 4.1, there is an attempt first to compress the page and store it in the virtual machine’s compression cache.
Swapped memory is the amount of memory which is swapped, again this should be ideally zero. Swapping is a process which comes in only if TPS and Ballooning don’t help and cannot reclaim memory. At virtual machine startup, the hypervisor creates a separate swap file for the virtual machine. Then, if necessary, the hypervisor can directly swap out guest physical memory to the swap file, which frees host physical memory for other virtual machines.
This post should give you an idea about the important memory numbers which you should monitor.
Thanks for reading.