#29450 [Bgs]: massive memmory problem in domxml_open_mem

From: Date: Fri, 30 Jul 2004 15:41:51 +0000
Subject: #29450 [Bgs]: massive memmory problem in domxml_open_mem
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-63813@lists.php.net to get a copy of this message
ID: 29450 User updated by: bo at theaddedones dot com Reported By: bo at theaddedones dot com Status: Bogus Bug Type: DOM XML related Operating System: MAC OS X, AMD Altholon, SOLARIS PHP Version: 4.3.8 New Comment: hmm, i'm not sure this is a 'bogus' bug, there is no documentation on this little 'free' function (although is certainly works)...so perhaps the 'bug' is more of a documentation thing (i.e. i did not know the 'free' function exsisted) Previous Comments: ------------------------------------------------------------------------ [2004-07-30 09:09:50] chregu@php.net use $dd->free() instead of unset($dd). ------------------------------------------------------------------------ [2004-07-29 22:09:26] bo at theaddedones dot com forgot to include the config bits for the system... System => Linux pict2.pictopia.com 2.6.6-1.435.2.3smp #1 SMP Thu Jul 1 08:51:38 EDT 2004 x86_64 Build Date => Jul 1 2004 15:03:35 Configure Command => './configure' '--enable-mbstring=all' '--enable-bcmath' '--enable-calender' '--enable-mailparse' '--enable-shmop' '--enable-shared' '--enable-sysvsem' '--with-gettext=/export/home/imgdb' '--with-mysql=/export/home/imgdb/mysql' '--with-mysql-sock=/export/home/imgdb/mysql/locks/mysql.sock' '--with-curl=/export/home/imgdb/' '--enable-exif' '--enable-ftp' '--enable-mbstring' '--with-openssl=/export/home/imgdb' '--enable-mbregex' '--enable-session' '--enable-sockets' '--enable-tokenizer' '--enable-wddx' '--with-xml' '--enable-trans-id' '--enable-track-vars' '--with-imap=/export/home/imgdb/imap-2004' '--with-imap-ssl=/export/home/imgdb/imap-2004' '--with-bz2' '--with-mcrypt=/export/home/imgdb' '--with-crypt' '--with-iconv=/export/home/imgdb' '--enable-cgi' '--enable-cli' '--with-mhash=/export/home/imgdb' '--with-tiff-dir=/export/home/imgdb' '--with-zlib=/export/home/imgdb' '--with-ttf' '--with-iconv-dir=/export/home/imgdb' '--with-freetype' '--with-freetype-dir=/export/home/imgdb' '--with-pear' '--with-mod_charset' '--with-apxs2=/export/home/imgdb/apache2.0.50/bin/apxs' '--with-gd' '--enable-gd-native-ttf' '--with-dom=/export/home/imgdb' '--with-dom-xslt=/export/home/imgdb' '--with-jpeg-dir=/export/home/imgdb' '--with-png-dir=/export/home/imgdb' '--with-dom-exslt=/export/home/imgdb' '--enable-force-cgi-redirect' '--enable-discard-path' '--enable-fastcgi' '--enable-rule=EAPI' '--enable-pcntl' '--enable-inline-optimizations' '--with-config-file-scan-dir=/export/home/imgdb/conf/php' '--prefix=/export/home/imgdb' --relvevant DOM things domxml DOM/XML => enabled DOM/XML API Version => 20020815 libxml Version => 20609 HTML Support => enabled XPath Support => enabled XPointer Support => enabled DOM/XSLT => enabled libxslt Version => 1.1.6 libxslt compiled against libxml Version => 2.6.8 DOM/EXSLT => enabled libexslt Version => 1.1.6 ---this also happens on a php 4.3.4 system (OS X) with these domxmls bits domxml DOM/XML => enabled DOM/XML API Version => 20020815 libxml Version => 20603 HTML Support => enabled XPath Support => enabled XPointer Support => enabled DOM/XSLT => enabled libxslt Version => 1.1.1 libxslt compiled against libxml Version => 2.6.3 DOM/EXSLT => enabled libexslt Version => 1.1.1 ------------------------------------------------------------------------ [2004-07-29 22:02:52] bo at theaddedones dot com Description: ------------ I know this issue has been resolved in PHP 5.0 using DomDocument::loadXML, BUT in non 5.0 versions, the loading of string XML (memmory) bits has some serious garbage collection problems...namely repeated calls to domxml_open_mem eats the memmory of the system alive.... unsetting variables has no effect.... Reproduce code: --------------- $tt = '<?xml version="1.0" encoding="ISO-8859-1"?> <data> <ff> <rrr>555</rrr> <rrrr>5555</rrrr> <rrrrr>55555</rrrrr> <rrrrrr>555555</rrrrrr> <rrrrrrr>5555555</rrrrrrr> <rrrrrrrr>55555555</rrrrrrrr> <rrrrrrrrr>555555555</rrrrrrrrr> </ff> </data>'; for($i=0;$i<100000;$i++){ $dd = domxml_open_mem($tt); unset($dd); } Expected result: ---------------- not to have the system memory jump by Megabytes...if the loop is left for longer it will eventually chew all resources Actual result: -------------- massive eating of memmory ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29450&edit=1

« previous php.bugs (#63813) next »