Simple way to modify shared memory in Linux operating system

  
                  

Recently in the optimization of oracle, encountered the oracle SGA size is much larger than the maximum shared memory of the Linux system, so that when I use the ipcs command to view, the oracle SGA area is divided into 10 segments, this Greatly affected the speed of the oracle's response. Later, after consulting the data, I came up with a simple way to modify the shared memory and share it with everyone.


Generally think that modifying the system shared memory requires modifying the kernel program, then make, it is very troublesome. In fact, as long as you add something to rc.local, you can avoid the trouble of modifying the kernel. Modify it as follows: Modify the /etc/rc.d/rc.local file.


Add the following line after the comment in front of the file:


#Modify the kernel shared memory size;


echo 134217728 > /Proc/sys/kernel/shmmax;


# Description: The value here is half of the memory;


#If the system memory is 256M, the value is 134217728; Br>


#If the system memory is 512M, the value is 268435456;


After the modification is completed, restart the machine and get it.


The default shared memory size of linxu seems to be 32M. I used ipcs to view my machine before modification. The oracle segment is 10, after modification, there is only one. Oracle is in a memory segment, which makes the speed of data exchange increase.

Copyright © Windows knowledge All Rights Reserved