Should Linux VM’s in VMware/ESX have a swap partition?

Ignoring the fact that people are dealing with OS specific reasons I have two reasons why it’s a bad idea to not run with a swap partition/file.

  1. If you have 1.5 GB of RAM allocated to a VM with no space file/partition and it wants to use 1.5 GB + 1 MB it will report an out of memory error. With the swap space it will be able to swap data out of active memory and onto the disk.
  2. The guest OS does a much better job of memory management than the host. This is why technology like memory ballooning exists because the Host can make educated guesses on what memory isn’t needed right now but the guest knows at a much more intelligent level (this keeps OS memory from being swapped out which could kill your performance).

Leave a Comment