SHMALL and SHMMAX on Linux

shmall 是全部允许使用的共享内存大小

shmmax 是单个段允许使用的大小

这两个可以设置为内存的 90%

  1. 查看内存Page的大小
  2. adam@adam-desktop:~$ getconf PAGE_SIZE
    4096
  3. 查看目前的内存参数设置
  4. 方法一:
    adam@adam-desktop:~$ ipcs -l
    
    ------ Shared Memory Limits --------
    max number of segments = 4096
    max seg size (kbytes) = 2097152
    max total shared memory (kbytes) = 8388608
    min seg size (bytes) = 1
    
    ------ Semaphore Limits --------
    max number of arrays = 128
    max semaphores per array = 250
    max semaphores system wide = 32000
    max ops per semop call = 100
    semaphore max value = 32767
    
    ------ Messages: Limits --------
    max queues system wide = 1711
    max size of message (bytes) = 8192
    default max size of queue (bytes) = 16384
    
    方法二:
    adam@adam-desktop:~$ cat /proc/sys/kernel/shmmax
    2147483648
    adam@adam-desktop:~$ cat /proc/sys/kernel/shmall
    2097152
  5. 修改内存参数设置的过程
  6. 修改/etc/sysctl.conf文件
    运行 sysctl -p

  7. 查看oracle占用的内存段
  8. oracle@adam-desktop:/home/adam$ ipcs | grep oracle
    0xe53c4b00 2490388    oracle     640        528482304  27
    0x3cf1d9d0 98304      oracle     640        154

参考文章:

One Response

Subscribe to comments with RSS.