You can add, change, or configure virtual machine memory resources or options to improve virtual machine performance. You can set most of the memory parameters during virtual machine creation or after the guest operating system is installed.

Some actions require that you power off the virtual machine before changing the settings.

The memory resource settings for a virtual machine determine how much of the host's memory is allocated to the virtual machine. The virtual hardware memory size determines how much memory is available to applications that run in the virtual machine. A virtual machine cannot benefit from more memory resources than its configured virtual hardware memory size. ESXi hosts limit the memory resource use to the maximum amount useful for the virtual machine, so that you can accept the default of Unlimited memory resources.

Change the Memory Configuration

You can reconfigure the amount of memory allocated to a virtual machine to improve performance.

Minimum memory size is 4 MB for virtual machines that use BIOS firmware. Virtual machines that use EFI firmware require at least 96 MB of RAM or they cannot power on.

Maximum memory size for virtual machines that use BIOS firmware is 24560 GB. You must use EFI firmware for virtual machines with memory size greater than 6128 GB.

Maximum memory size for a virtual machine depends on the physical memory of the ESXi host and the virtual machine compatibility settings.

If the virtual machine memory is greater than the host memory size, swapping occurs, which can have a severe effect on virtual machine performance. The maximum for best performance represents the threshold above which the physical memory of the ESXi host is insufficient to run the virtual machine at full speed. This value fluctuates as conditions on the host change, for example, as virtual machines are powered on or off.

The memory size must be a multiple of 4 MB.

Table 1. Maximum Virtual Machine Memory
Introduced in Host Version Virtual Machine Compatibility Maximum Memory Size
ESXi 8.0 Update 3 ESXi 8.0 Update 3 and later 24560 GB
ESXi 8.0 Update 2 ESXi 8.0 Update 2 and later 24560 GB
ESXi 8.0 Update 1 ESXi 8.0 Update 1 and later 24560 GB
ESXi 8.0 ESXi 8.0 and later 24560 GB
ESXi 7.0 Update 3 ESXi 7.0 Update 3 and later 24560 GB
ESXi 7.0 Update 2 ESXi 7.0 Update 2 and later 24560 GB
ESXi 7.0 Update 1 ESXi 7.0 Update 1 and later 24560 GB
ESXi 7.0 ESXi 7.0 and later 6128 GB
ESXi 6.7 Update 2 ESXi 6.7 Update 2 and later 6128 GB
ESXi 6.7 ESXi 6.7 and later 6128 GB
ESXi 6.5 ESXi 6.5 and later 6128 GB
ESXi 6.0 ESXi 6.0 and later 4080 GB

The ESXi host version indicates when support began for the increased memory size. For example, the memory size of a virtual machine with ESXi 6.0 and later compatibility running on ESXi 6.5 is restricted to 4080 GB.

Prerequisites

Verify that you have the Virtual machine.Configuration.Change Memory privilege on the virtual machine.

Procedure

  1. Right-click a virtual machine in the inventory and select Edit Settings.
  2. On the Virtual Hardware tab, expand Memory and change the memory configuration.
    1. In the Memory text box, enter the amount of RAM to assign to the virtual machine.
    2. Select whether the memory is specified in MB, GB or TB.
  3. Click OK.

Allocate Memory Resources

You can change the amount of memory resources allocated to a virtual machine by using the shares, reservations, and limits settings. The host determines the appropriate amount of physical RAM to allocate to virtual machines based on these settings. You can assign a high or low shares value to a virtual machine, depending on its load and status.

The following user-defined settings affect the memory resource allocation of a virtual machine.
Limit
Places a limit on the consumption of memory for a virtual machine. This value is expressed in megabytes.
Reservation
Specifies the guaranteed minimum allocation for a virtual machine. The reservation is expressed in megabytes. If the reservation cannot be met, the virtual machine will not turn on.
Shares
Each virtual machine is granted a number of memory shares. The more shares a virtual machine has, the greater share of host memory it receives. Shares represent a relative metric for allocating memory capacity. For more information about share values, see the vSphere Resource Management documentation.

You cannot assign a reservation to a virtual machine that is larger than its configured memory. If you give a virtual machine a large reservation and reduce its configured memory size, the reservation is reduced to match the new configured memory size.

Prerequisites

Verify that the virtual machine is powered off.

Procedure

  1. Right-click a virtual machine in the inventory and select Edit Settings.
  2. On the Virtual Hardware tab, expand Memory, and allocate the memory capacity for the virtual machine.
    Option Description
    Reservation

    Guaranteed memory allocation for this virtual machine.

    Limit

    Upper limit for this virtual machine’s memory allocation. Select Unlimited to specify no upper limit.

    Shares

    The values Low, Normal, High, and Custom are compared to the sum of all shares of all virtual machines on the server.

  3. Click OK.

Change Memory Hot Add Settings

Memory hot add lets you add memory resources for a virtual machine while that virtual machine is powered on.

Enabling memory hot add produces some memory overhead on the ESXi host for the virtual machine.
Note: If the ESXi host is of version 7.0 Update 2 and earlier, hot-adding memory to a virtual machine with NVIDIA vGPU requires that the ESXi host has a free vGPU slot. Starting with vSphere 7.0 Update 3, the source host does not require to have a free vGPU slot.

Prerequisites

  • Power off the virtual machine.
  • Verify that the virtual machine has a guest operating system that supports memory hot add functionality.
  • Verify that the virtual machine compatibility is ESXi 4.x and later.
  • Verify that VMware Tools is installed.

Procedure

  1. Right-click a virtual machine in the inventory and select Edit Settings.
  2. On the Virtual Hardware tab, expand Memory, and select Enable to enable adding memory to the virtual machine while it is powered on.
  3. Click OK.

Results

You can now add memory to a virtual machine, even if the virtual machine is turned on.

Add an NVDIMM device to a VM in the VMware Host Client

Add a virtual NVDIMM device to a virtual machine to enable it to use non-volatile, or persistent, computer memory. Non-volatile memory (NVM), or persistent memory (PMem), combines the high data transfer rates of the volatile memory with the persistence and resiliency of traditional storage. The virtual NVDIMM device is a virtual NVM device that can retain stored data through reboots or power source failures.

Virtual machines consume the PMem resource of the host through a virtual non-volatile dual in-line memory module (NVDIMM) or through a virtual persistent memory disk.

For more information about persistent memory, see Manage Persistent Memory

Prerequisites

  • Verify that the guest OS of the virtual machine supports PMem.
  • Verify that the virtual hardware version is 14 or later.
  • Verify that you have the Datastore.Allocate space privilege.
  • Verify that the host or the cluster on which the virtual machine resides has available PMem resources.

Procedure

  1. Click Virtual Machines in the VMware Host Client inventory.
  2. Right-click a virtual machine in the list and select Edit settings from the pop-up menu.
  3. Under the Virtual Hardware tab, click Add other device and select NVDIMM from the drop-down menu.
    The NVDIMM device appears in the Virtual Hardware devices list. Each virtual machine can have a maximum of 64 NVDIMM devices.
  4. Configure the newly added NVDIMM device.
    1. In the Virtual Hardware devices list, expand New NVDIMM.
    2. Enter the size of the new NVDIMM device.
      Note: You can change the size of the NVDIMM device at a later time. The virtual machine must be powered off.
    3. Select the NVDIMM controller location or leave the default one.
  5. Click Save to close the wizard.