7 Replies Latest reply on Apr 20, 2010 1:13 PM by ChrisJenkins-Oracle

    failed to lock memory

    726348
      In odbc.ini, I set MemoryLock=4, and in /etc/security/limits.conf (timesten is installed as oracle user)
      oracle soft memlock 131072
      oracle hard memlock 131072

      But when I tried to use ttisql, it reported that
      712: Unable to lock data store memory segment, error 12.
      It seems that there is not enough memory. But in fact, when use free command, it shows that there still have 6718332 free memory.
      [oracle@testdl380c bin]$ free
      total used free shared buffers cached
      Mem: 16439076 6718332 9720744 0 175420 1674916
      -/+ buffers/cache: 4867996 11571080
      Swap: 522104 0 522104

      Anything wrong in my configuration?
      thanks
        • 1. Re: failed to lock memory
          ChrisJenkins-Oracle
          To use MemoryLock there are several prerequisites:

          1. You must be running on a platform that supports MemoryLock (looks like you are on Linux so you are okay there).

          2. Depending on platform you may need to configure the kernel and/or O/S to (a) allow locking of memory and (b) to set the amount of memory that can be locked (we'll come back to this in a moment).

          3. On some platforms you need to run the TT dameons as 'root' in order to lock memory (none of the major ones need this nowadays fortunately).

          4. When setting the amount of memory that can be locked you need to allow for the entire TT shared memory segment. The best way to get the size of this is with the ipcs command to directly observer it. The size is typically (PermSize + TempSize + LogBufMB + 'overhead') here 'overhead varies from release to release and platform to platform but is typically in the 15 - 20 MB range.

          For Linux specifically you need to ensure that the value specified in /etc/limits/security.conf is sufficient according to the above formula (or better still to the size reported via ipcs).

          Chris
          1 person found this helpful
          • 2. Re: failed to lock memory
            726348
            Chris
            thanks for yoru quick reply.

            My platform is RedHat Linux 64bit (Intel(R) Xeon(R) CPU).

            Edited by: ramon_lmj on Apr 20, 2010 1:50 AM
            • 3. Re: failed to lock memory
              ChrisJenkins-Oracle
              Okay. Did you check that the value you have specified for memlock soft/hard limit is sufficient based on the size of the datatsore segment as per my previous post?

              Chris
              • 4. Re: failed to lock memory
                726348
                yes. I checked. originally the value was too small. but after i enlarged the value to meet the formula, it still didn't work.
                • 5. Re: failed to lock memory
                  Jspalmer-Oracle
                  Please can you paste in your DSN definitions and the output from /bin/cat /proc/meminfo. Could you have allocated an amount of memory to Huge Pages already, such that not enough is left to be locked via MemoryLock?
                  • 6. Re: failed to lock memory
                    726348
                    DSN definition:
                    [ttsize]
                    DataStore=/home/oracle/cache/ttsize
                    PermSize=128
                    OracleNetServiceName=rccpp
                    DatabaseCharacterSet=AL32UTF8
                    LogBufMB=128
                    MemoryLock=4


                    cat /proc/meminfo


                    [root@xxx]# cat /proc/meminfo
                    MemTotal: 16439076 kB
                    MemFree: 2759932 kB
                    Buffers: 2520668 kB
                    Cached: 9190484 kB
                    SwapCached: 0 kB
                    Active: 5966140 kB
                    Inactive: 5920668 kB
                    HighTotal: 0 kB
                    HighFree: 0 kB
                    LowTotal: 16439076 kB
                    LowFree: 2759932 kB
                    SwapTotal: 522104 kB
                    SwapFree: 522104 kB
                    Dirty: 3304 kB
                    Writeback: 0 kB
                    AnonPages: 173596 kB
                    Mapped: 21188 kB
                    Slab: 1691000 kB
                    PageTables: 6264 kB
                    NFS_Unstable: 0 kB
                    Bounce: 0 kB
                    CommitLimit: 8708872 kB
                    Committed_AS: 542180 kB
                    VmallocTotal: 34359738367 kB
                    VmallocUsed: 262720 kB
                    VmallocChunk: 34359475447 kB
                    HugePages_Total: 32
                    HugePages_Free: 32
                    HugePages_Rsvd: 0
                    Hugepagesize: 2048 kB
                    • 7. Re: failed to lock memory
                      ChrisJenkins-Oracle
                      So, the total memory needed for your datastore (assuming this is using TimesTen 11g) is 128 + 128 + 32 + 'overhead' which is around 302 MB = 309248 KB. So, the value specified in /etc/security/limits.conf needs to be at least this much. You might want to make it higher in case the 'overhead' is a bit bigger (or check the actual segment size using ipcs and make sure the value is at least that).

                      Also, after changing /etc/security/limits.conf you need to (a) log off and then back on again to pick up the new value and (b) stop and start the TimesTen main daemon so that it also picks up the new value. If you don't do both of these then the new value will not be in effect.

                      I also notice you swap space appears to be grossly under configured. Your machine has 16 GB of RAM and it looks like you only have ~512 MB of swap. You really ought to have at least 24 GB of swap configured.

                      Chris