5 Replies Latest reply: Sep 26, 2012 6:55 PM by cj RSS

    S11 + OIC + oci8 huge memory consumption

      Hi all,

      recently, I have upgraded my Solaris boxes
      Solaris 10 with php5.3.8+oci8 compiled with instant client 10.2
      Solaris 11 + php5.3.13+oci8 compiled with instant client bundled with solarisstudio IPS repo (developer/solarisstudio-123/oic).

      After that upgrade however, the apache memory consumption dramatically increased from average 25-35MB RSS to 80-110MB RSS per apache process.
      The architecture remains the same - OS is 64-bit and php+apache is 32-bit (x86).
      I'm posting "pmap -x" output before and after the upgrade (displaying only lines above 1500KB):
      Address Kbytes RSS Anon Locked Mode Mapped File
      E9830000 1772 144 - - r-x-- cs_CZ.UTF-8.so.3
      FD600000 1844 700 - - r-x-- libicui18n.so.48.0
      FC600000 8704 3496 - - r-x-- libphp5.so.5.3.8
      FA600000 12268 4096 - - r-x-- libclntsh.so.10.1
      080B9000 14876 14104 12516 - rwx-- [ heap ]
      FB400000 17764 140 - - r-x-- libicudata.so.48.0
      F6200000 65536 - - - rw-s- [ anon ]
      E9A00000 70972 780 - - r-x-- libociei.so
      EE000000 131072 7628 - - rw-s- [ anon ]
      total Kb 348452 42648 13268 -

      Address Kbytes RSS Anon Locked Mode Mapped File
      FEDF0000 1352 852 - - r-x-- libc_hwcap2.so.1
      FB800000 1460 764 - - r-x-- libmysqlclient.so.16.0.0
      FE6A0000 1816 76 - - r-x-- libnss3.so
      FBC00000 2124 2100 - - r-x-- mbstring.so
      FE000000 2276 2136 - - r-x-- libxml2.so.2
      F6400000 2324 2116 - - r-x-- libnnz11.so
      FA600000 7516 6456 - - r-x-- libphp5.so
      080D8000 30604 28884 26760 - rw--- [ heap ]
      F6800000 38160 35076 - - r-x-- libclntsh.so.11.1
      EF400000 113100 16544 - - r-x-- libociei.so
      total Kb 220040 106480 27404 -

      My question is: is this normal? Does the oracle instant client always consume that much memory? Or is there any tuning possibility to reduce used RAM?

      Does anybody experience simmilar behavior?

      Thank you for your help.


      Edited by: 926844 on Sep 17, 2012 2:56 AM
        • 1. Re: S11 + OIC + oci8 huge memory consumption
          On Linux, I can see an increase between 10.2 and 11.2 Instant Client but not as dramatic as the one you see on Solaris.

          Was PHP running the same application for the same length of time?

          Where did the 10.2 Instant Client come from - was it the Basic or Basic Lite package? Can you test using the Solaris Instant Client zip files?

          The RSS memory should be shared by all processes using Instant Client and shouldn't be duplicated. Check Oracle Support note "How to Tell How Much Memory is Being Used by a Process with Solaris [ID 1003055.1]"

          The problems doesn't appear to be PHP related. The best places to follow up are one of the Solaris forums https://forums.oracle.com/forums/category.jspa?categoryID=303 and the Instant Client forum Instant Client
          • 2. Re: S11 + OIC + oci8 huge memory consumption
            Hi cj,

            Thank you for your answer. You inspired me to search for shared memory and I've discovered that on the old system I can see shared memory (ipcs command below), but on the new system, there is no shared memory (empty list from ipcs command).
            ipcs -ma
            IPC status from <running system> as of Wed Sep 19 10:04:02 CEST 2012
            Shared Memory:
            m 50331666 0x100876e rw----- root root root root 7 80924 2298 2298 9:28:35 no-entry 9:28:35
            (PID number is apache master process)

            Is there any php compile option to enable this?
            My configure args:
            ./configure prefix=/usr/local/php with-config-file-path=/usr/local/php/lib with-libxml-dir=/usr/local with-zlib=/usr/local with-xpm-dir=/usr/local with-mysql=/usr/local/mysql with-mysqli=/usr/local/mysql/bin/mysql_config with-apxs2=/usr/local/apache2/bin/apxs without-pgsql with-jpeg-dir=/usr/local/lib with-zlib-dir=/usr/local/lib with-gd=/usr/local enable-mbstring enable-shared enable-exif enable-sockets enable-soap with-png-dir=/usr/local/lib with-curl=/usr/local with-ldap=/usr/local with-openssl=/usr/local/ssl with-gettext with-pcre-dir=/usr/local with-freetype-dir=/usr/local with-mssql=/usr/local/freetds with-oci8=instantclient,/opt/instantclient_10_2

            ./configure prefix=/usr/local libexecdir=/usr/local/libexec/php5 with-config-file-path=/usr/local/etc/php5 with-config-file-scan-dir=/usr/local/etc/php5/conf.d with-exec-dir=/usr/local/bin with-apxs2=/usr/apache2/2.2/bin/apxs disable-static enable-dom=shared with-openssl=shared,/usr with-openssl-dir=/usr with-zlib=shared,/usr with-curl=shared,/usr with-iconv=shared with-gd with-jpeg-dir=/usr with-png-dir=/usr with-zlib-dir=/usr with-xpm-dir=/usr with-freetype-dir=/usr enable-gd-native-ttf enable-gd-jis-conv enable-exif=shared with-gettext=shared,/usr enable-mbstring=shared enable-pdo=yes with-mysql=shared,/usr/mysql/5.1 with-mysqli=shared,/usr/mysql/5.1/bin/mysql_config with-pdo-mysql=shared,/usr/mysql/5.1/bin/mysql_config with-unixODBC=no with-snmp=no enable-soap=shared enable-sockets=shared enable-sysvmsg=shared enable-sysvsem=shared enable-sysvshm=shared enable-xml with-libexpat-dir=/usr with-xsl=shared,/usr enable-wddx=shared enable-xmlreader=shared with-xmlrpc=shared enable-pcntl=shared with-mime-magic=shared enable-json=shared enable-filter=shared enable-zip=shared with-pcre-regex enable-session=shared with-pear=/usr/local/share/pear enable-cli disable-cgi with-ldap=shared,/usr with-ldap-sasl=no with-libxml-dir=/usr disable-debug with-oci8=instantclient,/opt/solarisstudio12.3/OIC/arch32 --with-mcrypt=/usr

            Thank you for any hints.

            • 3. Re: S11 + OIC + oci8 huge memory consumption
              What's the base problem you have? What are you trying to solve?

              Oracle Client doesn't use shared memory. If it did, only user data would be shared; the RSS size wouldn't be affected. (The Oracle Database does use shared memory)

              How did you go with the suggestions/questions in my previous comment? It's best to change only one thing when doing comparisons; currently you are changing PHP versions and PHP extensions and Instant Client library versions.
              • 4. Re: S11 + OIC + oci8 huge memory consumption

                during the delay I've tried this:

                1) I've recompiled the php using old options and using newest oracle instant client 11.2 from oracle download site (instantclient-basic + instantclient-sdk).
                It did help, but not that much: the apache processes had about 75-90 MB each. It is 10-15 megabytes decrease in average, but still far from 30-40 MB.
                2) So I've tried to recompile it using instant client 10.2.
                The resulting process size is about 50 MB, which is acceptable. So I'll stick to 10.2 libs (hoping there won't be any problem connecting to 11g database).

                So I'll try to answer my original question: yes, it is probably normal that the IC 11 eats that much memory and no, apparently there are no tuning options for that.
                Thank you for your help.

                • 5. Re: S11 + OIC + oci8 huge memory consumption
                  I'm not convinced you are interpreting the data you have correctly. We also don't know what load you are under and what your expected usage is. If the extra RSS mem is shared across all processes then the absolute increase per machine is small. Yes, Anon went up - is that a problem? What are you trying to fit on the machine? Without the 11g client you miss out on things like client result caching, DRCP connecting pooling, REF CURSOR prefetching etc. With those things you might find your applications are faster and you need fewer client processes.

                  Anyway, the Solaris forum folk are more able to help you analyze memory use.