VMware Cloud Community
TheNuts
Contributor
Contributor

VM/ESX memory utilization

I have a Windows 2008 x64 VM that is allocated 4GB RAM. Task Manager shows: Physical Memory (MB): 5118 Cached: 1460 and Free 81...the memory bar shows 4.07GB

Looking in vCenter, the Active Memory is 1894MB and the Consumed Memory is 4982MB.

Should the Active Memory in that vCenter is reporting be equal to the Memory used in Task Manager? I understand the 4982MB of Consumed Memory is the amout of memory that the ESX host is using to run the VM, correct?

Reply
0 Kudos
12 Replies
cebomholt
Enthusiast
Enthusiast

Reply
0 Kudos
RustyRus
Enthusiast
Enthusiast

They should not be the same.

Your VM may be given up too 8gb of RAM for use. If it only needs 1gb at the time that is all that will show. At the same time if your CPU is running at 80% in task manager, If could be 10% of the one processer is is allocated but that is all the resources it needs at the moment.

Vsphere client is the only place to get accurate readings on your processer and memory usage.

Also look at what is reserved and what is allocated to the machine (reserve meaning always allocated to machine).

The above link is also good info.

Reply
0 Kudos
AWo
Immortal
Immortal

Should the Active Memory in that vCenter is reporting be equal to the Memory used in Task Manager?

No, active memory is where ESX is actually seeing activity.

I understand the 4982MB of Consumed Memory is the amout of memory that the ESX host is using to run the VM, correct?

Yes, the asisgned RAM plus the overhead.

Check this document: http://communities.vmware.com/docs/DOC-9279


AWo

VCP 3 & 4

\[:o]===\[o:]

=Would you like to have this posting as a ringtone on your cell phone?=

=Send "Posting" to 911 for only $999999,99!=

vExpert 2009/10/11 [:o]===[o:] [: ]o=o[ :] = Save forests! rent firewood! =
Reply
0 Kudos
rickardnobel
Champion
Champion

I have a Windows 2008 x64 VM that is allocated 4GB RAM. Task Manager shows: Physical Memory (MB): 5118 Cached: 1460 and Free 81...the memory bar shows 4.07GB

Looking in vCenter, the Active Memory is 1894MB and the Consumed Memory is 4982MB.

First, are you really sure that you have given the VM 4GB of RAM? It does look like it has 5GB actually. What do you see in the Task Manager for "Available" (under Cached)?

Win2008 will use memory free memory for filecaching and similar and that could be given up if you are loading more processes. (Value "Cached"). The "memory" graphical display bar shows how much memory that your processes have allocated at the moment, in your example about 4 GB. The rest is used for caching (about 1 GB).

From the Vmkernel side: the 4982 MB consumed means that your server is using that amount of physical memory on the host, but it knows that on average that only 1894 has been recently used. This means that if there is any need it could probably reclaim a good amount of it through the "balloon driver" for example.

My VMware blog: www.rickardnobel.se
Reply
0 Kudos
TheNuts
Contributor
Contributor

Thank you everyone for your posts!

Ricnob, I was mistaken, the VM is assihned 5GB...it was 4GB...someone must have added 1GB last week when I was on vacation.

So, if the VM is given 5GB, is it common for the ESX Host to use all 5GB and show 5GB as consumed? That sounds like a Hyper-V (Pre R2) thing to me where you the RAM assigned to the VM is taken right from the Host itself. So a host with 10GB RAM could only have 5, 2GB VMs

So, inside a VM, what is the real use of looking at Task manager in regards to RAM?

Reply
0 Kudos
rickardnobel
Champion
Champion

So, if the VM is given 5GB, is it common for the ESX Host to use all 5GB and show 5GB as consumed? That sounds like a Hyper-V (Pre R2) thing to me where you the RAM assigned to the VM is taken right from the Host itself.

When you have plenty of RAM left in the physical host there is no need for the host to do anything about it. When it is starting to become full (about 6% free) it will start to check with the VMs if there is free space inside them, this is done with the so called balloon driver.

There is also the Transparent Page Sharing which will run all the time and check for identical pages between VMs.

>So a host with 10GB RAM could only have 5, 2GB VMs

If this five would be different operating systems and run different applications and really use all of their RAM then yes, only five would fit.

If they would run the same operating systems, say Windows 2008 and also not have allocated all their internal RAM then no, more VMs would fit.

My VMware blog: www.rickardnobel.se
Reply
0 Kudos
AWo
Immortal
Immortal

Connect to the console, run "esxtop", press "m" and post the result. Mark which guest you're talking about. With "esxtop" you get a good picture of memory usage.


AWo

VCP 3 & 4

\[:o]===\[o:]

=Would you like to have this posting as a ringtone on your cell phone?=

=Send "Posting" to 911 for only $999999,99!=

vExpert 2009/10/11 [:o]===[o:] [: ]o=o[ :] = Save forests! rent firewood! =
Reply
0 Kudos
TheNuts
Contributor
Contributor

Great to know...thank you!

One more quick question...I have 3 VMs on 1 host that are showing swap usage. VM1 is using 429MB, VM2 is using 87 MB and VM3 is using 75MB. 2 of the VMs are 2008 and the other is 2003. Each VM has 2GB RAM assigned to them. The Host has 40GB RAM with 50% free

Why the swapping on those VMs?

Reply
0 Kudos
rickardnobel
Champion
Champion

One more quick question...I have 3 VMs on 1 host that are showing swap usage. VM1 is using 429MB, VM2 is using 87 MB and VM3 is using 75MB. 2 of the VMs are 2008 and the other is 2003. Each VM has 2GB RAM assigned to them. The Host has 40GB RAM with 50% free

Why the swapping on those VMs?

With "swap" do you mean vmkernel swap, that is swapping on the host, or that swapping goes on inside the guests?

It would be great if you could do an esxtop as suggested above from this host and post a screenshot!

My VMware blog: www.rickardnobel.se
Reply
0 Kudos
TheNuts
Contributor
Contributor

I assume vmkernel swap.  Looking at the swapped counter in vCenter for those VMs

Reply
0 Kudos
rickardnobel
Champion
Champion

I assume vmkernel swap. Looking at the swapped counter in vCenter for those VMs

That is strange and also not good. If the VMs are given to small amount of internal RAM they would be forced to use their internal pagefile more, but the vmkernel swap should only be used when the total memory of the physical server is full. Vmkernel swap is very bad for your performance.

Since you say you have a large amount of free memory there should be no active swaping going on. It could have been some situation earlier where the host memory was full and it was forced to swap out some part of the VMs memory, and that memory has not been touched by the VMs and remains in the vmkernel swap even now when having large amounts of free physical RAM.

My VMware blog: www.rickardnobel.se
Reply
0 Kudos
cebomholt
Enthusiast
Enthusiast

Agree with ricnob. You can usually look at counters for current swap

activity (swap out rate) to determine if the VM is actively swapping.

Assuming there is physical memory free in the host, pages will be

swapped back in to RAM as they are accessed.

Two things you may check:

1.) Is there a memory limit configured on the VM?

2.) Have you oversubscribed memory on the host? If so, pay attention to

granted vs active memory at the host level.

Reply
0 Kudos