This site is currently read-only as we are migrating to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 30th, when you will be able to use this site as normal.

    Forum Stats

  • 3,889,831 Users
  • 2,269,775 Discussions


S11 + OIC + oci8 huge memory consumption

929847 Member Posts: 5
edited Sep 26, 2012 7:55PM in PHP
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--
FD600000 1844 700 - - r-x--
FC600000 8704 3496 - - r-x--
FA600000 12268 4096 - - r-x--
080B9000 14876 14104 12516 - rwx-- [ heap ]
FB400000 17764 140 - - r-x--
F6200000 65536 - - - rw-s- [ anon ]
E9A00000 70972 780 - - r-x--
EE000000 131072 7628 - - rw-s- [ anon ]
total Kb 348452 42648 13268 -

Address Kbytes RSS Anon Locked Mode Mapped File
FEDF0000 1352 852 - - r-x--
FB800000 1460 764 - - r-x--
FE6A0000 1816 76 - - r-x--
FBC00000 2124 2100 - - r-x--
FE000000 2276 2136 - - r-x--
F6400000 2324 2116 - - r-x--
FA600000 7516 6456 - - r-x--
080D8000 30604 28884 26760 - rw--- [ heap ]
F6800000 38160 35076 - - r-x--
EF400000 113100 16544 - - r-x--
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


  • Christopher Jones-Oracle
    Christopher Jones-Oracle Member Posts: 1,657 Employee
    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 and the Instant Client forum 3192
    Christopher Jones-Oracle
  • 929847
    929847 Member Posts: 5
    edited Sep 19, 2012 4:51AM
    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.

  • Christopher Jones-Oracle
    Christopher Jones-Oracle Member Posts: 1,657 Employee
    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.
    Christopher Jones-Oracle
  • 929847
    929847 Member Posts: 5

    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.

  • Christopher Jones-Oracle
    Christopher Jones-Oracle Member Posts: 1,657 Employee
    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.
This discussion has been closed.