VMware Cloud Community
buchbri
Contributor
Contributor

Swap File Not reduced with Memory Reservation

I have 3 virtual servers on a host. The host has 320GB of ram.

I have 2 at 32GB and my SQL server at 256gb.

Since I won't be over committing RAM i have locked the Ram on all 3 servers.

However when I shutdown a VM and start it back up the swap file returns with the full size

of the RAM.

As you can imagine 320gb of disk that is not usable is a lot.

Please help me get my disk space back.

4 Replies
scott28tt
VMware Employee
VMware Employee

Did the VM go into a powered off state? The swap is created for a VM when you power it on, so it would need to be in an off state first.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
Reply
0 Kudos
tayfundeger
Hot Shot
Hot Shot

Did you select reserve all guest memory? If this option is checked, a swap file should not be created.

In addition, after selecting reserve all guest memory, you need to turn the virtual machine on / off.

--
Blog: https://www.tayfundeger.com
Twitter: https://www.twitter.com/tayfundeger

vBlogger, vExpert, Cisco Champions

Please, if this solution helped your problem, "Helpful" if it solves your problem "Correct Answer" to mark.
buchbri
Contributor
Contributor

The VM was indeed shut down and I selected reserve all.

I think the issue was the maximum was set to unlimited. I made it match the allocated RAM and powered down again and this time it came back as 0 kb.

.

Should the maximum have to be set as well.

Reply
0 Kudos
tayfundeger
Hot Shot
Hot Shot

Selecting unlimited memory has nothing to do with the swap. The use of the memory limit option is slightly different. For example, you have assigned 128GB of memory to a virtual machine, and you don't want that virtual machine to exceed 64GB. In this case, you can limit it to 64GB.

However, if you give 128GB to a virtual machine, this virtual machine cannot exceed the 128GB limit. So it doesn't matter if it is unlimited or if you write 128GB in the limit section.

--
Blog: https://www.tayfundeger.com
Twitter: https://www.twitter.com/tayfundeger

vBlogger, vExpert, Cisco Champions

Please, if this solution helped your problem, "Helpful" if it solves your problem "Correct Answer" to mark.