A: You don't ever want any computer to run out of memory. If it happens, the computer will crash. That's why memory management techniques are used by every computer to ensure memory never completely runs out. With physical computers, the typical solution involves swapping memory to disk. Virtual computers, on the other hand, have more options.
Consider those options available to virtual machines (VMs) and hosts in vSphere 4.1. Because a vSphere environment views memory at three different levels—host physical memory for the hypervisor, guest physical memory for the VM's OS, and guest virtual memory for its applications—you can use different techniques to maintain memory while also constraining its use.
Your options include transparent page sharing, where a computer removes redundant memory pages that contain identical content. Ballooning, artificially increasing memory pressure inside a VM to reclaim memory, is another option. When these techniques aren't enough, ESX's hypervisor can directly swap out memory through hypervisor swapping, which transfers memory to disk. That transfer to disk is always a last resort, so vSphere 4.1 adds memory compression as a last-ditch alternate. With this technique, memory pages are compressed prior to swapping. If the compression rate is high enough, the memory can stay resident and not suffer the performance penalty of being moved to disk.
Remember that any of these techniques are intended for use when memory contention exists. Contention means that there isn't enough memory available for the needs of the hosts and its VMs. The best solution for memory management is always to simply have enough memory available.
Interested in learning more? VMware's "Understanding Memory Resource Management in VMware ESX 4.1" document goes into deep detail on the techniques at its disposal.