Contents

Memory contention between the host and its virtual machines

The memory that a virtual machine uses comes out of the same pool of memory that is used by all other applications running on the host, including the host operating system. To ensure smooth operation of the host operating system and its applications, Workstation limits the amount of the host's memory that can be locked by all virtual machines together, reserving a portion of the host's physical memory for exclusive use by the host. This reserved portion is dependent upon the physical memory size and the host operating system, but is typically less than 50% of the host"s physical memory by default. The rest of the host's physical memory can be used exclusively by virtual machines, ensuring that virtual machines can execute more efficiently because memory required for their operations is reserved solely for their use. When Workstation is using the memory reserved for virtual machines, it is not available to the host operating system and other applications.

The memory used by Workstation includes the memory made available to the guest operating systems as well as overhead memory associated with running a virtual machine. The amount of reserved memory used by a virtual machine depends on the working set of the guest operating system, essentially how much memory the guest operating system needs to run without experiencing poor performance plus a portion of overhead memory. The amount of overhead memory used by a virtual machine depends on the RAM of the host machine. For hosts with 256MB of RAM, the memory overhead is 16MB per virtual machine. For hosts with less than 256MB of RAM, the overhead value is 0MB per virtual machine. The amount of reserved memory actually used for a particular virtual machine varies dynamically as a virtual machine runs.

To provide good overall system performance, Workstation limits how many virtual machines can run at once based on the amount of available reserved memory. In doing so, Workstation prevents virtual machines from causing each other to perform poorly. Workstation permits an acceptable number of virtual machines to run simultaneously, ensuring that they work together to manage the reserved memory. If all this reserved memory is in use by one or more virtual machines, the host operating system will not be able to use this memory for any other purpose. Workstation uses the reserved memory only if it determines that a virtual machine needs the memory to have reasonable performance. Even if multiple virtual machines are running at the same time, Workstation may be using only a fraction of the reserved memory, thus allowing any unused reserved memory to be used by other applications running on the host.

Within the total amount of memory that is reserved for all virtual machines, an individual virtual machine can use at most the amount of memory configured in its configuration file plus some overhead. The amount of overhead memory required ranges from a few to less than 10 megabytes, depending on the size of the guest operating system and its behavior.

Workstation allows you to set the maximum amount of memory that it will reserve. The recommended amount of memory to reserve for applications is 50% of the host's physical memory. If you determine that you want Workstation to reserve more or less physical memory, you can change this amount. Changing the amount of reserved memory is recommended only for advanced users because it can have an adverse impact on the host or virtual machine performance. Selecting too much physical memory to reserve can cause the host to thrash, or even hang, if other applications are competing for memory on the host. Selecting too little physical memory to reserve can cause virtual machines to perform very poorly and also limit the number of virtual machines that can be run. This is because if free memory falls below a minimum value (specific to each host), the host operating system will continually free up memory by swapping to disk to maintain that amount of free memory. This pattern causes the virtual machine to run slowly as well.

By default, a virtual machine performs checks to ensure that enough free memory is left to the host machine to continue to operate efficiently:

If these checks fail, the virtual machine terminates. You can disable memory checks, but remember that disabling either of these checks can result in poor performance, and even system crashes.

Related Topics:

Back to top

© 2001 VMware, Inc. All rights reserved.