Chapter 7.15Setting Shared MemoryShared memory allows processes to access common structures and data by placing them in sharedmemory segments. It is the fastest form of inter-process communication available since no kernelinvolvement occurs when data is passed between the processes. In fact, data does not need to becopied between the processes.Oracle uses shared memory segments for the Shared Global Area (SGA) which is an area ofmemory that is shared by Oracle processes. The size of the SGA has a significant impact to Oracle'sperformance since it holds database buffer cache and much more.To see all shared memory settings, execute:$ ipcs -lm7.1. Setting SHMMAX ParameterThis parameter defines the maximum size in bytes of a single shared memory segment that a Linuxprocess can allocate in its virtual address space. For example, if you use the Red Hat EnterpriseLinux 3 smp kernel on a 32 bit platform (x86), then the virtual address space for a user process is3 GB. If you use the Red Hat Enterprise Linux 3 hugemem kernel on a 32 bit platform (x86), thenthe virtual address space for a user process is almost 4GB. Hence, setting SHMMAX to 4GB - 1 byte(4294967295 bytes) on a smp kernel on a 32 bit architecture will not increase the maximum size of ashared memory segment to 4 GB -1. Even setting SHMMAX to 4 GB - 1 byte using the hugemem kernelon a 32 bit architecture will not enable a process to get such a large shared memory segment. In fact,the upper limit for a shared memory segment for an Oracle 10g R1 SGA using the hugemem kernel isroughly 3.42 GB (~3.67 billion bytes) since virtual address space is also needed for other things likeshared libraries. This means if you have three 2 GB shared memory segments on a 32 bit system, noprocess can attach to more than one shared memory segment at a time. Also note if you set SHMMAXto 4294967296 bytes (4*1024*1024*1024=4GB) on a 32 bit system, then SHMMAX will essentiallybet set to 0 bytes since it wraps around the 4GB value. This means that SHMMAX should not exceed4294967295 on a 32 bit system. On x86-64 platforms, SHMMAX can be much larger than 4GB since thevirtual address space is not limited by 32 bits.Since the SGA is comprised of shared memory, SHMMAX can potentially limit the size of the SGA.SHMMAX should be slightly larger than the SGA size. If SHMMAX is too small, you can get errormessages similar to this one:ORA-27123: unable to attach to shared memory segmentIt is highly recommended that the shared memory fits into the Big Pages or Huge Pages pool, seeChapter 14, Large Memory Optimization, Big Pages, and Huge Pages.To increase the default maximum SGA size on x86 Red Hat Enterprise Linux 2.1 systems withoutVLM, refer to Chapter 15, Growing the Oracle SGA to 2.7 GB in x86 Red Hat Enterprise Linux 2.1Without VLM.To increase the default maximum SGA size on x86 Red Hat Enterprise Linux 3, 4 and 5 systemswithout VLM, refer to Chapter 16, Growing the Oracle SGA to 2.7/3.42 GB in x86 Red Hat EnterpriseLinux 3, 4 and 5 Without VLM..To determine the maximum size of a shared memory segment, run: