When Linux servers that host Oracle database environments are configured with 16GB or more of memory and the total SGA of the Oracle databases is 5GB or more, it is strongly recommended to configure Linux HugePages at the OS level. With HugePages, the Linux memory page size is set at 2MB (instead of the default 4K). This will dramatically improve OS performance when running Oracle databases with large SGA sizes.

Note: The Oracle 11g Automatic Memory Management (AMM) feature is not compatible with Linux HugePages. In order to utilize HugePages, the Automatic Shared Memory Management (ASMM) feature can be configured for the Oracle database.

To configure Oracle to support Linux HugePages, perform the following steps for each Oracle database on the server:

  • Set the Oracle parameters "memory_target" = 0 and "memory_max_target" = 0
  • Set the Oracle parameter "sga_target" = SGA size desired for the database
  • Set the Oracle parameter "pga_aggregate_target" = PGA size desired for the database
  • Restart the Oracle database to allow these parameter settings to take affect

Run this script: hugepages_settings.sh on each server to compute the kernel parameter value to enable the Linux HugePages configuration.

  • Once ASMM has been configured for all of the databases on the server and each has been restarted, execute the hugepages_settings.sh script as the root user.
  • The output from the script will be similar to this: vm.nr_hugepages = 9999 (where “9999” represents the value for the number of HugePages to allocate).
  • Edit the /etc/sysctl.conf file as root and add this parameter value at the end of the file. Save the file and exit the editor.
  • Copy the /etc/sysctl.conf file to the 2nd node of the cluster (if clustered system)
  • Reboot each server in the cluster – do not run command /etc/sysctl –p Rebooting the sever allows Linux to allocate HugePages as contiguous memory segments at system startup.
  • Once all of the Oracle databases have been started after the reboot, use the following command to check the HugePages usage: grep Huge /proc/meminfo

More information on configuring HugePages on Linux can be found in the My Oracle Support (MOS) document 361468.1 (or you can just search on “HugePages” in My Oracle Support to list all related documents).

Note: There is a bug in Oracle 11.2.0.1 Grid Infrastructure that manifests itself when HugePages is configured. The bug is corrected in Oracle 11.2.0.2. Refer to MOS document 983715.1 for an explanation of the bug and its work around.