2

I've seen this a few times now and I don't understand what is happening

I assigned a windows guest 200 gigs of RAM- NOT reserved.

Looking at the guest right now the OS shows its only using about 2 gigs of RAM.

ESXi though, has allocated it the full 200 gigs of RAM (the host is now generating low memory alerts)! Windows is only using 2 gigs so why has ESXi granted the VM all 200 gigs?

Is this a case of Windows demanding more RAM then it is using? How can I troubleshoot this?

  • What do you mean the Windows guest is only using 2GB? Do you mean that's the memory load as seen in Task Manager or Resource Monitor? How much memory does the Windows guest "see" in System Properties? – joeqwerty May 24 '16 at 23:55
  • The guest sees the full 200 gigs allocated to it and it is only utilizing about 2 GBs of that as seen in task manager – red888 May 25 '16 at 0:05
  • Are VMware tools installed and properly running in the guest system? – Massimo May 25 '16 at 0:05
  • tool are installed and running. I tried restarting the tools service, but this didn't solve the issue. – red888 May 25 '16 at 0:06
  • 2
    OK, I think I understand. You're asking why the host is not "reclaiming" the RAM from the VM, right? I thought you were asking why the guest wasn't using all of the RAM that was allocated to it. – joeqwerty May 25 '16 at 0:16
3

Quoting from here:

A host allocates the memory specified by the Limit parameter to each
virtual machine, **unless memory is overcommitted** (emphasis mine).
ESXi never allocates more memory to a virtual machine than its specified
physical memory size.

[...]

When memory is overcommitted, each virtual machine is allocated an
amount of memory somewhere between what is specified by Reservation
and what is specified by Limit. The amount of memory granted to a
virtual machine above its reservation usually varies with the current
memory load.

So, unless the host needs more memory than what it actually has in order to fulfill the requirements of all VMs running on it, it will happily allocate to each VM all the memory it requests, even if it's not reserved; however, if and when overcommitment happens, the host will reclaim some of this memory in order to free it up for other VMs; in this scenario, as much memory will be reclaimed as the load demands, until it reaches the reserved amound for each VM. If, even after bringing each VM's allocated RAM down to its reserved amount, the memory requirements for starting another VM can not be fulfilled, it will not be started. Of course, if a VM's memory is brought down to its reserved amount and this isn't enough for the VM to operate properly, slugginesh and/or errors will ensue.


Let's assume you have 300 GB of RAM and have two VMs, of which each one has a limit of 200 GBs. When you start the first one, it will get the full 200 GBs. When you start the second one, the host will try to fulfill both requests, but since it doesn't have 400 GBs available, it will setle down to giving 150 GBs to each VM. Then, depending on the actual load of those VMs, memory could be furtherly moved around: if a VM tries to use 180 GBs while the other one is sitting at 20 GBs, the host will move 30 additional GBs from the second VM to the first one.

Of course, if both VMs tries to use all 200 GBs, the host will start swapping like crazy; that's your clue to add more RAM or move one VM somewhere else.

  • But when a host reclaims memory it balloons right? Don't you want to avoid ballooning? So if the host says its 99% utilizing its RAM, but the guests are only using 30% of the actual RAM I have nothing to worry about? As long as I know that the guests aren't actually using that RAM I'm OK? – red888 May 25 '16 at 0:25
  • 3
    The host will report a "low memory" condition, but it's only a warning, it isn't actually low on memory; it's just saying "be careful, if your VMs are actually going to use all the RAM I've allocated to them, you'll get in troubles". – Massimo May 25 '16 at 0:26
  • 2
    This begs the question: Why have you allocated so much RAM to the guests? Does this particular guest really need 200GB of RAM? – joeqwerty May 25 '16 at 0:35
  • 1
    I personally never over allocate RAM it's the one thing I never want there to be contention over - due to the penalties that kick in when the ballooning driver tries to "help" balance things. – Stewpudaso May 26 '16 at 22:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.