Chapter 14. Large Memory Optimization, Big Pages, and Huge Pages42• pages are locked in memory and are never swapped out which guarantees that shared memorysuch as SGA remains in RAM.• contiguous pages are pre-allocated and cannot be used for anything else but for System V sharedmemory, for example SGA.• less bookkeeping work for the kernel in that part of virtual memory due to larger page sizes.14.2. Usage of Big Pages and Huge Pages in Oracle 9i and10gBig pages are supported implicitly in Red Hat Enterprise Linux 2.1. But Huge Pages in RedHat Enterprise Linux 3, 4 and 5 need to be requested explicitly by the application by using theSHM_HUGETLB flag when invoking the shmget() system call. This ensures that shared memorysegments are allocated out of the Huge Pages pool. This is done automatically in Oracle 10g and 9iR2 (9.2.0.6) but earlier Oracle 9i R2 versions require a patch, see Metalink Note:262004.1.14.3. Sizing Big Pages and Huge PagesWith the Big Pages and Huge Pages feature you specify how many physically contiguous largememory pages should be allocated and pinned in RAM for shared memory like Oracle SGA. Forexample, if you have three Oracle instances running on a single system with 2 GB SGA each, then atleast 6 GB of large pages should be allocated. This will ensure that all three SGAs use large pagesand remain in main physical memory. Furthermore, if you use ASM on the same system, then it isprudent to add an additional 200MB. I have seen ASM instances creating between 70 MB and 150MB shared memory segments. And there might be other non-Oracle processes that allocate sharedmemory segments as well.It is, however, not recommended to allocate too many Big or Huge Pages. These pre-allocated pagescan only be used for shared memory. This means that unused Big or Huge Pages will not be availablefor other use than for shared memory allocations even if the system runs out of memory and startsswapping. Also take note that Huge Pages are not used for the ramfs shared memory file system,see Section 14.8, “Huge Pages and Shared Memory File System in Red Hat Enterprise Linux 3”, butBig Pages can be used for the shm file system in Red Hat Enterprise Linux 2.1.14.4. Checking Shared Memory Before Starting OracleDatabasesIt is very important to always check the shared memory segments before starting an instance. Anabandoned shared memory segment, from an instance crash for example, is not removed, it willremain allocated in the Big Pages or Huge Pages pool. This could mean that new allocated sharedmemory segments for the new instance SGA will not fit into the Big Pages or Huge Pages pool. Formore information on removing shared memory, see Section 7.4, “Removing Shared Memory”.14.5. Configuring Big Pages in Red Hat Enterprise Linux 2.1Before configuring Big Pages, ensure to have read Section 14.3, “Sizing Big Pages and Huge Pages”.Note that Big Pages in x86 Red Hat Enterprise Linux 2.1 can only be allocated and pinned aboveapproximately 860MB of physical RAM which is known as Highmem or high memory region in x86.