Thursday, December 15, 2011

ORA-27102: out of memory - Set the kernel parameters

When trying to increase the SGA to approach half available RAM with an Oracle 64-bit version on a Linux 64-bit operating system, even though shmmax is set to match half the amount of  RAM, you get the following error when trying to start the instance:

SQL> startup nomount
ORA-27102: out of memory
Linux-x86_64 Error: 28: No space left on device  


shmall is too small, most likely is set to the default setting of 2097152
$ cat /proc/sys/kernel/shmall


shmall is the total amount of shared memory, in pages, that the system can use at one time.


Set shmall equal to the sum of all the SGAs on the system, divided by the page size.
The page size can be determined using the following command:
$ getconf PAGE_SIZE
For example, if the sum of all the SGAs on the system is 16Gb and the result of  '$ getconf PAGE_SIZE' is 4096 (4Kb) then set shmall to 4194304 pages
As the root user set the shmall to 4194304 in the /etc/sysctl.conf file:
kernel.shmall = 4194304

then run the following command:
$ sysctl -p
$ cat /proc/sys/kernel/shmall

The above command loads the new value and a reboot is not necessary.
Switch back to being the oracle user and retry the startup command.
Modifying /etc/sysctl.conf is a permanent workaround (applies at boot time). If for some reason you DO NOT want to change the system wide configuration, you can do it on the fly by directly changing the kernel pseudo FS AKA procfs.
e.g. echo "4194304" > /proc/sys/kernel/shmall

Using HUGEPAGES does not alter the calculation for configuring shmall.

 Set the kernel parameters
Add the following the lines in the file /etc/sysctl.conf
kernel.shmall = physical RAM size / pagesize For most systems, this will be the value 2097152. See Note 301830.1 for more information.
kernel.shmmax = 1/2 of physical RAM. This would be the value 2147483648 for a system with 4Gb of physical RAM.
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 512 x processes (for example 65536 for 128 processes)
Development recommends a minimum of 327679 for active systems.
net.ipv4.ip_local_port_range = 9000 65500
(The runInstaller (OUI) checks may expect this to be the old guidance of 1024 65000.
The new guidance from Oracle development is 9000 65500.
Please allow the runInstaller (OUI) to proceed with the new guidance from Oracle development.)
net.core.rmem_default = 262144
net.core.rmem_max = 2097152
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
To place these changes into effect, execute the command
# sysctl -p

No comments: