php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #13649 IBM DB2 memory leak
Submitted: 2001-10-12 04:23 UTC Modified: 2002-12-28 10:52 UTC
From: clacetera_sysnet at bci dot it Assigned: kalowsky (profile)
Status: Closed Package: Performance problem
PHP Version: 4.0.6 OS: linux red hat 6.2/7.1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: clacetera_sysnet at bci dot it
New email:
PHP Version: OS:

 

 [2001-10-12 04:23 UTC] clacetera_sysnet at bci dot it
Systems Used Linux RedHat 6.2 + db2 6.1
Systems Used Linux RedHat 7.1 + db2 7.2

I'm using php with ibm-db2 and I'm experiencing a large amount of memory used by apache. Up to 20-30 MB !!!
If I stress the system with simple or complex SQL queries the used memory amount grows.
an hack that I've tried is to impose a memory limit patch to php, but I've obtained no positive results.

The module is compiled as shared.

there is another problem with libpthread.so that i have to preload with LD_PRELOAD=path_to lipthread.so.*


this is my configure line

'./configure'   '--disable-debug' \
                '--disable-pear' \
                '--disable-static' \
                '--enable-pic' \
                '--enable-inline-optimization' \
                '--enable-track-vars' '--with-apxs' \
                '--with-xml' \
                '--with-ftp'\
                '--with-gd' \
                '--with-ttf' \
                '--enable-freetype-4bit-antialias-hack' '--enable-sysvsem' '--enable-sysvshm' \
                '--enable-calendar' \
                '--without-mysql' \
                '--enable-safe-mode' \
                '--with-system-regex' \
                '--with-prefix=/usr' \
                '--with-config-file-path=/etc/httpd/' \
                '--with-versioning' \
                '--with-gettext=/bin/gettex' \
                '--with-ibm-db2=shared' \
                '--with-ldap=shared' \
                '--enable-memory-limit'  


this is ldd of libphp.so

libpam.so.0 => /lib/libpam.so.0 (0x40129000)
        libdl.so.2 => /lib/libdl.so.2 (0x40131000)
        libgd.so.1.8 => /usr/lib/libgd.so.1.8 (0x40135000)
        libttf.so.2 => /usr/lib/libttf.so.2 (0x40168000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x40192000)
        libresolv.so.2 => /lib/libresolv.so.2 (0x401c0000)
        libm.so.6 => /lib/i686/libm.so.6 (0x401d3000)
        libnsl.so.1 => /lib/libnsl.so.1 (0x401f8000)
        libc.so.6 => /lib/i686/libc.so.6 (0x4020f000)
        libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x4033f000)
        libpng.so.2 => /usr/lib/libpng.so.2 (0x4035e000)
        libz.so.1 => /usr/lib/libz.so.1 (0x4037f000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)    

and this is ldd of odbc.so

 libdb2.so.1 => /usr/IBMdb2/V7.1/lib/libdb2.so.1 (0x4002c000)
        libc.so.6 => /lib/i686/libc.so.6 (0x4088c000)
        libcrypt.so.1 => /lib/libcrypt.so.1 (0x409bc000)
        libdl.so.2 => /lib/libdl.so.2 (0x409ea000)
        libpthread.so.0 => /lib/i686/libpthread.so.0 (0x409ee000)
        libstdc++-libc6.1-1.so.2 => /usr/lib/libstdc++-libc6.1-1.so.2 (0x40a03000)
        libm.so.6 => /lib/i686/libm.so.6 (0x40a46000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)   


the module odbc.so must be loaded with dl('odbc.so') each time from the script, if i include this is php.ini the httpd  give me a segmentation fault (problem to resolve libpthread???)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-12-12 19:13 UTC] yohgaki@php.net
Could you try PHP 4.1.0 see if it help?
 [2001-12-15 13:55 UTC] kalowsky@php.net
This isn't fully a bug in PHP.  As I understand it this happens to be because of the method DB2 handles the releasing of the cursor.  Which is something PHP can't change really.  But the way PHP works with the cursor isn't any good either, and that needs to be changed... which will hopefully get rid of this problem.  Problem being a patch I have for the cursor update doesn't fully work on many of the supportd DBs by ODBC.  So it's still in development...
 [2002-12-28 10:52 UTC] kalowsky@php.net
I'm going to mark this as fixed, as there was a memory leak in the PHP side of things that has been fixed (in 4.2.0 I believe).  The outstanding issue of cursors is still true though.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 29 18:01:30 2024 UTC