VMware vSphere

 View Only
  • 1.  Guest Memory Usage is always less than Host Memory Usage

    Posted Mar 24, 2013 07:44 PM

    Hi All

    The question might have been asked by lot of people. But i am still pretty confused in getting a better understanding of the memory management techniques that VMware will follow. Especially with the current problem that i am facing. I am having hard time in understanding that. I have an ESXi Host with 32 GB of RAM and only one single Machine is running on it. The VM is allotted 32 GB RAM (the complete physical RAM available on the host) and running Windows 2008 Enteprise with Microosft Failover cluster services with MS SQL on top of them. As this is the Active MS SQL node, I have moved all the other VMs and the Passive MS SQL node to other hosts in the Vcenter Cluster. Eventhoug the VM is utilizing around 16 to 20 GB of Ram in the Guest OS, the Host is showing 90% utilization all the time in the vCenter Hosts Utilization view. I have disabled the Balloning and there is no much chance of the TPS in this scenario and wondering about the host always touching 90 to 95 % of the utilization.

    I have attached few screenshots for better understanding.

    Host-Memory Screenshot - Screenshot captured in the performance tab on the host level

    Guest Memory Screenshot - Screenshot captured in the performance tab on the Guest VM

    Guest-Memory-1 Screenshot - Guest VM memory Usage at the vCenter Level - Red Block showing the Host Memory utilization and Guest Memory Utilization.

    Any Quick understandable help would be appreciated.

    Thanks



  • 2.  RE: Guest Memory Usage is always less than Host Memory Usage

    Posted Mar 24, 2013 08:13 PM

    With the Windows VM being the only VM running on the host, the host will allocate physical memory pages for the VM as it requests/touches memory. Windows likes to initialize memory on boot and other occasions, which it later does not necessarily in use (from the guest point of view). However, once allocated, the host does not know which memory pages are in use by the guest and which aren't. If you would power on another VM on this host now, VMware's memory techniques (TPS, ballooning, ...) would start to do their job.

    André



  • 3.  RE: Guest Memory Usage is always less than Host Memory Usage

    Posted Mar 27, 2013 03:37 PM

    krish1438 wrote:

    Eventhoug the VM is utilizing around 16 to 20 GB of Ram in the Guest OS, the Host is showing 90% utilization all the time in the vCenter Hosts Utilization view.

    Could you post a screenshot from inside the Guest VM with Task Manager in the Performance tab?



  • 4.  RE: Guest Memory Usage is always less than Host Memory Usage

    Posted Mar 27, 2013 03:52 PM

    Hi Ricardnobel

    Screenshot attached.

    Thanks



  • 5.  RE: Guest Memory Usage is always less than Host Memory Usage

    Posted Mar 27, 2013 04:29 PM

    Thanks,

    could you also attach a screenshot from vSphere Client of this VM and the tab called "Resource allocation"?



  • 6.  RE: Guest Memory Usage is always less than Host Memory Usage

    Posted Mar 27, 2013 04:54 PM

    Hi,

    As a.p. mentioned, Windows will write "0" in all of its memory for security reasons at boot time. In your case (1 VM with "all" host memory assigned to it)it means that you will see almost all of your memory as consumed even when it is not being actually used by your VM.

    This could clarify things:

    http://communities.vmware.com/docs/DOC-10398

    "Note that for a host that is not memory overcommitted, the Consumed  memory represents a “high water mark” of the memory usage by the VM. It  is possible that in the past, the VM was actively using a large amount  of host physical memory but currently it is not. Because host memory is  not overcommitted, the Consumed memory will not be shrunk through  ballooning or swapping. Hence, the Consumed memory could be much higher  than the Active memory when host memory is not overcommitted."

    If you have the chance to start an ssh session in that host and run "esxtop", you will get a better understanding of the memory usage.

    TPS won't affect you much as there are no other VMs to "share" the memory pages with. And ballonning will require memory from your VM only if you have contention for memroy resources which I don't think you have (from the screenshots you posted).

    Please have into account that this is only my interpretation of the document I posted here and it may be wrong (I don't develop this software, only use it and try to understand it like you do ):smileyhappy: .

    Hope this helped!!!

    Best regards,

    elgreco81



  • 7.  RE: Guest Memory Usage is always less than Host Memory Usage

    Posted Mar 27, 2013 04:59 PM

    Attached Screenshot



  • 8.  RE: Guest Memory Usage is always less than Host Memory Usage

    Posted Mar 27, 2013 08:37 PM

    The memory consumtion seems to have got some now. However the numbers does not really match up.

    From the Resource view we can see that that VM consumes about 23 GB of physical RAM of the host.

    Around 8 GB is "shared", which means taken care of by TPS, which in this case means detecting zeros in the guest RAM and collapsing these into one page.

    From inside the VM we can see that it uses around 16.6 GB for processes and uses 1.8 GB for cachin, in total around 18 GB used by the operating system.

    This means that about 5 GB more is consumed by the VM on the host level than the Windows server uses internally, and that this 5 GB is not zeroes. The most likely cause is that some program has been locating pages into RAM and then has delocated them logically, but the actual data is left inside the OS ram, waiting to be overwritten / zeroed later. From the outside the vmkernel can not reclaim that by TPS until the OS from the "inside" has zeroed out the RAM.