[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Vmware Swap file

Posted on 2014-02-23
5
Medium Priority
?
803 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
Teach the user how to convert virtaul disk file formats and how to rename virtual machine files on datastores. Open vSphere Web Client: Review VM disk settings: Migrate VM to new datastore with a thick provisioned (lazy zeroed) disk format: Rename a…
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.

650 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