This discussion is archived
5 Replies Latest reply: Nov 19, 2012 11:01 AM by Dude! RSS

sysctl -a shows 0 while it is set to 68719476736

Flake Newbie
Currently Being Moderated
Hi All,

I came across an issue while I was installing Oracle RAC 11g on Red Hat Linux.

I set kernel.shmmax=68719476736 in */etc/sysctl.conf* (This value is equal to 64 GB). But, my RAM is only 4 GB. So, while I was executing sysctl -a | grep shm, the value shown was kernel.shmmax=0. But, sysctl -p shows the value specified in /etc/sysctl.conf

Then I tried with value 4294967296 (this value is equal to 4GB, the size of RAM) for kernel.shmmax in /etc/sysctl.conf. Both sysctl -a | grep shm and sysctl -p showed the same value (4294967296 ) set in /etc/sysctl.conf

My question is, why is sysctl -a | grep shm showing kernel.shmmax=0 while the value set was 68719476736?

Help is much appreciated.

Thanks
  • 1. Re: sysctl -a shows 0 while it is set to 68719476736
    Dude! Guru
    Currently Being Moderated
    Are you using 32-bit or x86_64-bit kernel?

    Anyway, the shmmax is just a safeguard parameter which sets the max. upper limit a process could theoretically allocate. You can set it to anything as high that the OS supports, but shouldn't set it lower to anything required by a process. Kernel.shmmax does not allocate any memory.
  • 2. Re: sysctl -a shows 0 while it is set to 68719476736
    Veeresh.S Pro
    Currently Being Moderated
    My question is, why is sysctl -a | grep shm showing kernel.shmmax=0 while the value set was 68719476736?
    in 32bit Address space can max point to 4GB(2^32) so if you give shmmax more than 4GB in 32bit than linux considers it has 0 bytes.......

    Official RedHat note : If you set SHMMAX to 4294967296 bytes (4*1024*1024*1024=4GB) on a 32 bit system, then SHMMAX will essentially bet set to 0 bytes since it wraps around the 4GB value. This means that SHMMAX should not exceed 4294967295 on a 32 bit system.

    ref (7.1. Setting SHMMAX Parameter) : https://access.redhat.com/knowledge/docs/en-US/Red_Hat_Enterprise_Linux/5/pdf/Tuning_and_Optimizing_Red_Hat_Enterprise_Linux_for_Oracle_9i_and_10g_Databases/Red_Hat_Enterprise_Linux-5-Tuning_and_Optimizing_Red_Hat_Enterprise_Linux_for_Oracle_9i_and_10g_Databases-en-US.pdf
  • 3. Re: sysctl -a shows 0 while it is set to 68719476736
    Flake Newbie
    Currently Being Moderated
    Hi Veeresh,

    That is what had happened to me. I set shmmax to a value exceeding 4GB. So, when that value was set to 4GB (in bytes), the issue was resolved. Thanks for that.

    Thanks,
    ...
  • 4. Re: sysctl -a shows 0 while it is set to 68719476736
    Veeresh.S Pro
    Currently Being Moderated
    Thanks for that.

    Thanks,
    ...
    If so then dont you think above 2 posts deserve some points.......................i haven't seen you giving points to anyone................have a habbit of giving points to the deserve ones before closing any thread.

    Edited by: Veeresh.S on Nov 19, 2012 7:35 PM
  • 5. Re: sysctl -a shows 0 while it is set to 68719476736
    Dude! Guru
    Currently Being Moderated
    Unfortunately forum members are not obliged to provide feedback, but to mark questions as answered and give credit to helpful replies will certainly avoid related issues.

    To my experience and from what I have seen so far, requesting feedback from people who do not show the courtesy to evaluate answers is useless. I guess the value of this forum comes from self-educating by trying to help others. I do however maintain a list of users that have a bad user profile and sometimes check before trying to answer a question, but I often forget to check.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points