Installation guide
Contiguous pages are preallocated and cannot be used for anything else but for System V shared memo-
ry (e.g. SGA)
Less kernel bookkeeping work for that part of virtual memory due to larger page sizes
Usage of Huge Pages in Oracle 10g
Huge Pages in Red Hat Enterprise Linux 5 need to be requested explicitly by the application by using the
SHM_HUGETLB flag when invoking the shmget() system call. This ensures that shared memory segments are
allocated out of the Huge Pages pool. This is done automatically in Oracle 10g.
Sizing Huge Pages
With the Huge Pages feature you specify how many physically contiguous large memory pages should be allo-
cated and pinned in RAM for shared memory like Oracle SGA. For example, if you have three Oracle instances
running on a single system with 2 GB SGA each, then at least 6 GB of large pages should be allocated. This
will ensure that all three SGAs use large pages and remain in main physical memory. Furthermore, if you use
ASM on the same system, then it is prudent to add at least 200MB. There may be other non-Oracle processes
that allocate shared memory segments as well.
It is, however, not recommended to allocate too many Huge Pages. These preallocated pages can only be used
for shared memory. This means that unused Huge Pages will not be available for other use than for shared
memory allocations even if the system runs out of memory and starts swapping. Note that Huge Pages are not
used for the ramfs shared memory file system.
Checking Shared Memory Before Starting Oracle Databases
It is very important to always check the shared memory segments before starting an instance. If an abandoned
shared memory segment from e.g. an instance crash is not removed, it will remain allocated in the Huge Pages
pool. This could mean that new allocated shared memory segments for the new instance SGA will not fit into
the Huge Pages pool. For more information on removing shared memory, see Removing Shared Memory.
Configuring Huge Pages in RHEL5
In Red Hat Enterprise Linux 5, the size of the Huge Pages pool is specified by the desired number of Huge
Pages. To calculate the number of Huge Pages you first need to know the Huge Page size. To obtain the size of
Huge Pages, execute the following command:
$ grep Hugepagesize /proc/meminfo
Hugepagesize: 2048 kB
$
The output shows that the size of a Huge Page on this system is 2MB, meaning if a 1GB Huge Pages pool
should be allocated, then 512 Huge Pages need to be allocated. The number of Huge Pages can be configured
and activated by setting nr_hugepages in the proc file system. For example, to allocate 512 Huge Pages, ex-
ecute:
# echo 512 > /proc/sys/vm/nr_hugepages
Alternatively, you can use sysctl(8) to change it:
www.redhat.com | 15