5.11 Modifying the Memory Allocated to a User Domain

The following procedure describes how to modify the memory allocated to a user domain:

Note:

This operation requires user domain restart. It is not supported to modify memory allocation using the xm mem-set command.

  1. If you are decreasing the amount of memory used by the user domain, then you must first review and adjust Oracle Database memory usage and the operating system huge pages configuration settings inside the user domain.
    1. Review the SGA size of databases and reduce if necessary.

      If you do not first reduce the memory requirements of the databases running in the user domain, then the user domain might fail to restart because too much memory is reserved for huge pages when the Oracle Linux operating system attempts to boot. See My Oracle Support Doc ID 361468.1 for details.

    2. Review the operating system configuration and reduce the memory allocation for huge pages if necessary.
    3. If you modify the huge pages settings in the operating system kernel configuration file (/etc/sysctl.conf), regenerate the initramfs file to reflect the system configuration change.

      You should backup up the existing initramfs file and then regenerate it by using the dracut command. For example:

      # ls -l /boot/initramfs-$(uname -r).img
      -rw------- 1 root root 55845440 Jan  8 10:34 /boot/initramfs-4.14.35-2047.508.3.3.el7uek.x86_64.img
      
      # cp /boot/initramfs-$(uname -r).img backup_directory
      
      # dracut --force
  2. Connect to the management domain (dom0).

    The remainder of this procedure is preformed inside the management domain.

  3. Use the following command to determine the amount of free memory available, when increasing the allocation:
    # xm info | grep free_memory

    Note:

    When assigning free memory to a user domain, approximately 1 to 2 percent of free memory is used for metadata and control structures. Therefore, the amount of memory increase possible is 1 to2 percent less than free memory value.

  4. Shut down the user domain gracefully using the name obtained from the xm list command. Use the -w option so the xm command waits until the domain is shut down before returning.
    # xm shutdown DomainName -w

    In the preceding command, DomainName is the name of the domain.

  5. Create a backup copy of the /EXAVMIMAGES/GuestImages/DomainName/vm.cfg file.
  6. Edit the memory and maxmem settings in the /EXAVMIMAGES/GuestImages/DomainName/vm.cfg file using a text editor. The memory and maxmem settings must be identical values.

    Note:

    If the memory and maxmem parameters are not identical values, then InfiniBand network interfaces are not configured during user domain start, which prevents proper Oracle CRS and database startup.

  7. Use the following command to start the user domain:
    # xm create /EXAVMIMAGES/GuestImages/DomainName/vm.cfg

    Note:

    To see Oracle Linux boot messages during user domain startup, connect to the console during startup using the -c option. To disconnect from the console after startup is complete, press CTRL+].