VMware Cloud Community
Centosuser
Enthusiast
Enthusiast

vm.swap

Dear All,

my SSD run out of space, after i checked the data stores i found hug files of .vswp

can i delete those files? i know they are swapping files. but i dont really need my server to swap.

can i just delete those two hug files?

pastedImage_0.png

0 Kudos
5 Replies
weinstein5
Immortal
Immortal

NO you cannot delete the .VSWP files - they are the VMkernel Swap files that are created when the VM is started - there two things you can do:

1) you can configure your ESXi hosts to create the swap files on other storage -

or

2) since the size if the swap file is equal to the amount of memory assigned to the VM minus the VMs memory reservation - so you can reduce the swap size by increasing the VMs reservation but this comes with risks in that you can get to the point where there you will not have enough physical resources on your host to satisfy the reservation -

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
Centosuser
Enthusiast
Enthusiast

thank you Weinstein,

is those swap files gonna keep grouwing ?

i mean somehow need to reduce the size of those otherwise the storage will be overloaded.

0 Kudos
weinstein5
Immortal
Immortal

No once created that is how large they stay - unless you increase memory of your VM and then when the VM starts a new VSWP will be created equal to the amount of memory assigned to the VM -

The swap files are not used if you host has sufficient memory and there is no contention for memory by the VMs -

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
Centosuser
Enthusiast
Enthusiast

the amount of swap file you see in the screen is it correct for 1024MB VM memory ?

thank you

0 Kudos
tomtom901
Commander
Commander

Actually, there are 2 kinds of swap files:

You have the VM swap file, which is equal to the configured amount of memory minus any memory reservation configured on the VM. You also have the VMX swap file, which you have selected in your first screenshot. This swapfile is for the VM's process (or world, rather).

In your example, the VM swap file is 2GB, and the VMX swap (used for the VM world) is 162 MB.

0 Kudos