bradduane
Contributor
Contributor

What happens to memory that is swapped to disk after RAM is freed?

I have a 2 host cluster. I want all VM's to run on one host in the event of a host failure. To test this, I vMotion all virtual machines to a single host while monitoring esxtop. I see that my VMKMEM state goes from high, to soft, and quickly to hard, causing much memory to be swapped to disk. This is understandable, because page sharing and ballooning take some time to reclaim memory.

After everything is settled down, I see that my host has 4GB of free memory, presumable reclaimed from page sharing, ballooning, and swapping. But, now that we have this much free memory, my RAM could now comfortably hold this data that was swapped.

Is there such a thing as "unswapping" or swapping back to RAM?

What happens to this 1GB that is swapped? Will it stay swapped until the guest frees it, possibly indefinitely hurting my memory performance, or will VMware move this memory back to RAM? When?

Reply
0 Kudos
bradduane
Contributor
Contributor

Based on this document here: http://pubs.vmware.com/vsphere-4-esx-vcenter/index.jsp?topic=/com.vmware.vsphere.resourcemanagement....

VMware shows the following values in esxtop:

SWAP (MB)

Displays the ESX/ESXi swap usage statistics. All numbers are in megabytes.

curr

Current swap usage.

rclmtgt

Where the ESX/ESXi system expects the reclaimed memory to be. Memory can be reclaimed by swapping or compression.

r/s

Rate at which memory is swapped in by the ESX/ESXi system from disk.

w/s

Rate at which memory is swapped to disk by the ESX/ESXi system.

So, "r/s" shows memory being swapped in from disk. But I have tested and I have since freed up much RAM by migrating some of my guests to another host. I still see a considerable amount of memory swapped, though it is not growing. Will this memory only swap back to RAM once it is accessed?

Reply
0 Kudos