Citrix Hypervisor

Memory usage

Two components contribute to the memory footprint of the Citrix Hypervisor server. First, the memory consumed by the Xen hypervisor itself. Second, there is the memory consumed by theControl Domainof the host. Also known as ‘Domain0’, or ‘dom0’, the control domain is a secure, privileged Linux VM that runs the Citrix Hypervisor management toolstack (XAPI). Besides providing Citrix Hypervisor management functions, the control domain also runs the driver stack that provides user created VM access to physical devices.

Control domain memory

The amount of memory allocated to the control domain is adjusted automatically and is based on the amount of physical memory on the physical host. By default, Citrix Hypervisor allocates1 GiB plus 5% of the total physical memoryto the control domain, up to an initial maximum of 8 GiB.

Note:

The amount reported in the Citrix Hypervisor section in XenCenter includes the memory used by the control domain (dom0), the Xen hypervisor itself, and the crash kernel. Therefore, the amount of memory reported in XenCenter can exceed these values. The amount of memory used by the hypervisor is larger for hosts using more memory.

Change the amount of memory allocated to the control domain

You can change the amount of memory allocated to dom0 by using XenCenter or by using the command line. If you increase the amount of memory allocated to the control domain beyond the amount allocated by default, this action results in less memory being available to VMs.

You might need to increase the amount of memory assigned to the control domain of a Citrix Hypervisor server in the following cases:

  • You are running many VMs on the server
  • You are using PVS-Accelerator
  • You are using read caching

The amount of memory to allocate to the control domain depends on your environment and the requirements of your VMs.

You can monitor the following metrics to judge whether the amount of control domain memory is appropriate for your environment and what effects any changes you make have:

  • Swap activity:If the control domain is swapping, increase the control domain memory.
  • Tapdisk mode:You can monitor whether your tapdisks are in low-memory mode from within the XenCenterPerformancetab for the server. SelectActions>New Graphand choose theTapdisks in low memory modegraph. If a tapdisk is in low-memory mode, increase the control domain memory.
  • Pagecache pressure:Use thetopcommand to monitor thebuff/cachemetric. If this number becomes too low, you might want to increase the control domain memory.

Changing the dom0 memory by using XenCenter

For information about changing the dom0 memory by using XenCenter, seeChanging the Control Domain Memoryin the XenCenter documentation.

Note:

You cannot use XenCenter to reduce dom0 memory below the value that was initially set during Citrix Hypervisor installation. To make this change you must use the command line.

Changing the dom0 memory by using the command line

Note:

On hosts with smaller memory (less than 16 GiB), you might want to reduce the memory allocated to the Control Domain to lower than the installation default value. You can use the command line to make this change. However, we recommend that youdo not reduce the dom0 memory below 1 GiBand that you do this operation under the guidance of the Support Team.

  1. On the Citrix Hypervisor server, open a local shell and log on as root.

  2. Type the following:

    /opt/xensource/libexec/xen-cmdline --set-xen dom0_mem=M,max:M 

    Whererepresents the amount of memory, in MiB, to be allocated to dom0.

  3. Restart the Citrix Hypervisor server using XenCenter or therebootcommand on the Citrix Hypervisor console.

    When the host restarts, on the Citrix Hypervisor console, run thefreecommand to verify the new memory settings.

How much memory is available to VMs?

To find out how much host memory is available to be assigned to VMs, find the value of the free memory of the host by runningmemory-free. Then type the commandvm-compute-maximum-memoryto get the actual amount of free memory that can be allocated to the VM. For example:

xe host-list uuid=host_uuid params=memory-free xe vm-compute-maximum-memory vm=vm_name total=host_memory_free_value 
Memory usage