Chapter 14. Large Memory Optimization, Big Pages, and Huge Pages46NoteIn order that an Oracle database can use Huge Pages in Red Hat Enterprise Linux 4 or 5,you also need to increase the ulimit parameter "memlock" for the oracle user in /etc/security/limits.conf if "max locked memory" is not unlimited or too small, seeulimit -a or ulimit -l. An example can be seen below.oracle soft memlock 1048576oracle hard memlock 1048576The memlock parameter specifies how much memory the oracle user can lock into its address space.Note that Huge Pages are locked in physical memory. The memlock setting is specified in KB andmust match the memory size of the number of Huge Pages that Oracle should be able to allocate.So if the Oracle database should be able to use 512 Huge Pages, then memlock must be set to atleast 512 * Hugepagesize, which on this system would be 1048576 KB (512*1024*2). If memlockis too small, then no single Huge Page will be allocated when the Oracle database starts. For moreinformation on setting shell limits, see Chapter 22, Setting Shell Limits for Your Oracle User.Log in as the oracle user again and verify the new memlock setting by executing ulimit -l beforestarting the database.After an Oracle DB startup you can verify the usage of Huge Pages by checking whether the numberof free Huge Pages has decreased:$ grep HugePages_Free /proc/meminfoTo free the Huge Pages pool, you can execute:# echo 0 > /proc/sys/vm/nr_hugepagesThis command usually takes a while to finish.14.8. Huge Pages and Shared Memory File System in RedHat Enterprise Linux 3The following example shows that the Huge Pages pool is not being used by the ramfs sharedmemory file systems. The ramfs shared memory file systems can be used for Configuring Very LargeMemory (VLM).The ipcs command shows only System V shared memory segments. It does not display sharedmemory of a shared memory file systems. The following command shows System V shared memorysegments on a node running a database with an SGA of 2.6 GB:# ipcs -m------ Shared Memory Segments --------key shmid owner perms bytes nattch status0x98ab8248 1081344 oracle 600 77594624 00xe2e331e4 1245185 oracle 600 2736783360 0The first shared memory segment of 74 MB was created by the ASM instance. The second sharedmemory segment of 2.6 GB was created by the database instance.