VCPGuru
Contributor
Contributor

VM is swapping, but host has enough memory!?

Dear all

Following story:

Host has enough free memory, two VMs swapped in the past (esxtop/memory/swcur).

If every VM would use all the reserved memory the host would be memory overcommited. But thats not the case, so why is my VMkernel swapping two of my 25 VMs?

Host in technical details: 12GB Memory free / 48GB memory in total --> ESX Cluster of 3 hosts

Any help would be appreciated

Simon

Best Regards Simon Ciglia
0 Kudos
8 Replies

Check if memory limit is set for these VMs.


---

MCSA, MCTS Hyper-V, VCP 3/4, VMware vExpert

http://blog.vadmin.ru

EMCCAe, MCITP: SA+VA, VCP 3/4/5, VMware vExpert http://blog.vadmin.ru
VCPGuru
Contributor
Contributor

no memory limits set on both VMs!

Best Regards Simon Ciglia
0 Kudos

Could you post memory performance screenshots for time periods with ballon and swap > 0?


---

MCSA, MCTS Hyper-V, VCP 3/4, VMware vExpert

http://blog.vadmin.ru

EMCCAe, MCITP: SA+VA, VCP 3/4/5, VMware vExpert http://blog.vadmin.ru
VCPGuru
Contributor
Contributor

here we go:

I already moved the other "swapping" VM to another host.....

Best Regards Simon Ciglia
0 Kudos
RParker
Immortal
Immortal

What's the VM, is it Linux?

I would look at the OS in the VM, this appears to be coming from inside the VM and memory must be low.

0 Kudos
rickardnobel
Champion
Champion

There seems not to be any ongoing swappning (from the SWAP /MB line, 0 reads and writes per second).

Is it possible that the host at some time was forced to swap this pages out to disk due to high memory pressure, and after this the pages has not been accessed by the guest operating system?

So even if the host now has plenty of memory I do not think it will "swap in" them if not requested from the VM.

My VMware blog: www.rickardnobel.se
0 Kudos
VCPGuru
Contributor
Contributor

Its a linux VM. So you think the memory has low memory utilization and that was the reason that VMkernel swapped the memory out?

Best Regards Simon Ciglia
0 Kudos
rickardnobel
Champion
Champion

Looking at the different statistics I think the following can be seen:

There is no swappning going on at the host, so there should be no real performance problem.

The value for PSHARE/MB common is quite high: 29 GB, which indicate that the Transparent Page Sharing has been working to reduce the memory footprint. This does not happen immediately, so for some period the host could have been under memory pressure and was forced to swap to disk.

In a certain VM, like your Linux VM, you can see that it has only recently touched 122 MB of the total memory of 2GB you have given to it. If the VM has not yet had any reason to access the pages it belives is in the physical RAM, but really is in the swap, then the pages will stay there.

If you would do something inside the VM that causes much memory access there is a chance the pages will be returned from swap, but I do not think you will gain much from this.

My VMware blog: www.rickardnobel.se
0 Kudos