?
Solved

Vmware Swap file

Posted on 2014-02-23
5
Medium Priority
?
783 Views
Last Modified: 2014-03-10
per vmware  whenever a VM is powered on , it creates a swap file with the same size as the dedicated RAM, and if it has memory reservation, then the swap file will be equal to Dediated RAM minus size of reserved RAM.

can someone explain the latter (why when there is memory reserved, the swap file will be smaller)?



Also I wonder if this swap file gets automatically removed without powering off the VM, seeing that VMs swap files can take a lot of disk space, if many of them are powered on.
by the way, is swap file the same as windows memory page (temporary memory)?

i
Thanks
0
Comment
Question by:jskfan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 123

Assisted Solution

by:Andrew Hancock (VMware vExpert / EE MVE^2)
Andrew Hancock (VMware vExpert / EE MVE^2) earned 1000 total points
ID: 39880916
Because that is the guaranteed size of memory which is required to start the VM, as you have defined by RESERVING the Memory requirement.

a virtual machine is configured with a reservation then the swap file will be an empty file with the size of (virtual machine memory configuration – VM memory reservation). e.g. , an 8GB virtual machine is configured with a 1024MB memory reservation, the size of the swap file will be 7168MB.

If the VM is Powered OFF, the SWAP file is removed, from the datastore, it's not required.

Remember this SWAP file is emprty, and only EVER used, if there is memory contention on the host, e.g. Host runs out our memory, and the VMs will then swap to disk!

If this happens performance will be poor, never let the host run out of memory.
0
 

Author Comment

by:jskfan
ID: 39881108
<<>Remember this SWAP file is emprty, and only EVER used, if there is memory contention on the host, e.g. Host runs out our memory, and the VMs will then swap to disk!>

even if it is empty , it will count on the capacity of datastore?

for instance if there is 2 GB disk space free on datastore and you power up a VM that has 4GB of RAM provisioned, VMware will not let it power on.
0
 
LVL 123
ID: 39881135
Correct, the space is allocated, but it's empty!

and it does not contain any zeros, or zeroed out!

see here......

http://frankdenneman.nl/2012/11/14/alternative-vm-swap-file-locations-qa/

for instance if there is 2 GB disk space free on datastore and you power up a VM that has 4GB of RAM provisioned, VMware will not let it power on.

correct, because the hypervisor, cannot create the swap file, because you have no storage space.
0
 
LVL 13

Accepted Solution

by:
Abhilash earned 1000 total points
ID: 39882415
A swap file is always created when the VM is powered on.
Remember that Swap space = Allocated memory- reserved memory.
It is needed only when the VM runs out of memory and it is the last step VMKernel takes after trying Transparent page Sharing, memory compression and Ballooning.
This is to ensure that guest does not run out of memory.
The swapping causes a high performance degradation so always avoid it.

<<Also I wonder if this swap file gets automatically removed without powering off the VM, seeing that VMs swap files can take a lot of disk space, if many of them are powered on.
by the way, is swap file the same as windows memory page (temporary memory)?>>

Yes swap file goes off when you power off the machine.
As you have already mentioned. If you have enough RAm you can reserve the memory so swap file creation does not take place.

Windows paging is controlled by OS. And happens on the disk assigned to VM. The swapping to the swap file is controlled by kernel and it is triggered by kernel only when it runs out of memory.
They are totally different from one another.
0
 

Author Closing Comment

by:jskfan
ID: 39918755
Thank you Guys!
0

Featured Post

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If we need to check who deleted a Virtual Machine from our vCenter. Looking this task in logs can be painful and spend lot of time, so the best way to check this is in the vCenter DB. Just connect to vCenter DB(default DB should be VCDB and using…
Veeam Backup & Replication has added a new integration – Veeam Backup for Microsoft Office 365.  In this blog, we will discuss how you can benefit from Office 365 email backup with the Veeam’s new product and try to shed some light on the needs and …
Teach the user how to install ESXi 5.5 and configure the management network System Requirements: ESXi Installation:  Management Network Configuration: Management Network Testing:
This video shows you how easy it is to boot from ISO images for virtual machines with the ISO images stored on a local datastore on the ESXi host.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question