Home / VMware vSphere / How to calculate the vSphere’s VM memory usage ?

How to calculate the vSphere’s VM memory usage ?

To understand, VMware’s memory management required some sort of skills. Because it had bounded  with many technologies like sharing the memory between virtual machines(TPS) , compressing the memory content, Eliminating the duplicate memory content etc…As a Unix/Linux/Windows admin , we can login to guest VM and check the current memory usage at the VM level. But to understand, how the VM is getting the physical memory at the ESXi level , You have to login in to vSphere Client and check the Resource Allocation tab.

Most the members get confused after seeing the VM’s resource allocation tab from vSphere Client. This article is going t0 explain how VMware is calculating the virtual memory and how to find the VM’s real memory usage.

Memory Usage from VM guest Level

Login to the guest OS and see how much memory in use .VM- Redhat Linux

# top
top - 10:45:26 up 243 days, 22:01,  1 user,  load average: 0.02, 0.02, 0.00
Tasks: 143 total,   1 running, 142 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.1%us,  0.0%sy,  0.0%ni, 99.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   5858188k total,  5792276k used,    65912k free,   245984k buffers
Swap:  2064376k total,       96k used,  2064280k free,  4968504k cached
# free -m
             total       used       free     shared    buffers     cached
Mem:          5720       5656         64          0        240       4852
-/+ buffers/cache:        564       5156
Swap:         2015          0       2015
#

According to the VM, physical memory is used 5656MB. (5.5GB~)

Memory usage from vSphere Client’s Resource allocation tab

Login to vSphere Client and Select host and clusters . Just find the VM and select the Resource allocation table.

VMware vSphere Client - VM Memory usage
VMware vSphere Client – VM Memory usage

After looking the Resource allocation tab, confusion begins about the VMware memory management.

We will see the memory terms in VMware vSphere and how it works  ?

  • What is Guest Memory ? Amount of Memory that you have allocated to the VM.
VM-Physical Memory
VM-Physical Memory

 

  • What is Host Memory ?     Amount of Memory that you have allocated to the VM + Overhead Memory in approx.(System will take it automatically).This actually refers the  random-access memory (RAM) that’s actually installed in the hardware that comprises the ESX server system. Note : The overhead memory size will be decided by VMkernel.  (Here I am not talking about overhead consumption .
Host Memory VS Guest Memory
Host Memory VS Guest Memory

 

  • What is overhead Memory ?      To manage VM , VMware ESXi’s VMkernel need additional memory space to maintain the virtual hardware. Depends on the VM’s  virtual resources, overhead memory will increase or decrease.
Overhead
Overhead Consumption

 

  • What is consumed Memory ?      The amount of memory space used by the virtual machine. (Private Memory + Overhead Consumption.).In My case ,it was not matching values perfectly because VMware tool is outdated.
Consumed Memory
Consumed Memory

Please go through this article to know more about Shared,Swapped,Compresses and Ballooned Memory. 

  • What is private Memory ? The amount of memory that has been committed to the VM at that time.
  • What is shared Memory ? Memory that has been provided by TPS. (Transparent Page Sharing)
  • What is Swapped Memory ? VM’s low priority pages that has been swapped by ESXi host. (Moving the physical Memory contents to the disk.)
  • What is Compressed Memory ? The swapped pages can be compressed by 50% ratio using memory compression technology. Amount of compressed Memory.
  • What is Ballooned ? Amount of Memory reclaimed  by the  balloon driver.
  • What is Un-Accessed ? The amount of memory that has been  untouched by VM.
  • What is Active ? The Amount of memory that has been recently used. (Read/Write).

The conclusion is that VM’s memory usage(5.5GB~) is matching to the consumed memory in vSphere Client. (5.49GB~).So you no need to calculate other fields value.

Summary:

Field Description
Private Amount of memory backed by host memory and not being shared.
Shared Amount of memory being shared.
Swapped Amount of memory reclaimed by swapping.
Compressed Amount of memory stored in the virtual machine’s compression cache.
Ballooned Amount of memory reclaimed by ballooning.
Unaccessed Amount of memory never referenced by the guest.
Active Amount of memory recently accessed.

Hope this article provides some idea about VMware memory management. We will see the Guest Memory in details in upcoming article.

Share it ! Comment it !! Be Sociable !!!

VMTURBO-CLOUD-CAPACITY

Leave a Reply

Your email address will not be published. Required fields are marked *