Page sharing, ballooning, and swapping — to expand or contract the amount of memory allocated dynamically for each virtual machine.
An ESX Server host uses a proprietary transparent page sharing technique to securely eliminate redundant copies of memory pages and is the most preferred memory reclamation technique among the three.
Between Swapping and Ballooning, Ballooning is the preferred method and provides predictable performance, which closely matches the behavior of a native system under similar memory constraints. With ballooning, ESX Server works with a VMware-supplied vmmemctl module loaded into the guest operating system to reclaim pages that are considered least valuable by the guest operating system. The vmmemctl driver is installed as part of VMware Tools. To use ballooning, the guest operating system must be configured with sufficient swap space. N.B. To disable Balloning, uninstall the vmmemctl driver!
Swapping is used to forcibly reclaim memory from a virtual machine when both page sharing and ballooning fail to reclaim sufficient memory from an overcommitted system. If the working set (active memory) of the virtual machine resides in physical memory, using the swapping mechanism and having inactive pages swapped out does not affect performance. However, if the working set is so large that active pages are continuously being swapped in and out (that is, the swap I/O rate is high), then performance may degrade significantly. To avoid swapping in specific virtual machines please configure memory reservations for them (through the VI Client) at least equal in size to their active working sets. But be aware that configuring resource reservations can limit the number of virtual machines one can consolidate on a system.
The vmmemctl approach (ballooning) is used whenever possible for optimum performance. Swapping is a reliable mechanism of last resort that the system uses to reclaim memory only when necessary and leads to significant performance hit. So place the per virtual machine swap files on the fastest available storage.
Source: Vmware.com