Menu

VM Guest Memory – Watch these numbers !

I have been using VMware vSphere client for a while now and the person who inspired me to use this wonderful tool is none other than Brent Ozar(B/T).I’m a great fan of his webcasts.

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.

” 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.