[PHP-DEV] [Fwd: Memory leak in domxml?] From: Thomas Gagne (tgagne <email protected>)
Date: 06/22/01

After opening the bug at php.net, I was expecting it might have shown-up here,
but it may not have due to the news server being down. Just in case, here it
is.

--
.tom

Path: spln!rex!extra.newsguy.com!newsp.newsguy.com!news2 From: Thomas Gagne <tgagne <email protected>> Newsgroups: alt.php Subject: Memory leak in domxml? Date: Sun, 03 Jun 2001 15:15:31 -0400 Organization: eFinNet, Corp. Message-ID: <3B1A8CD2.8147041D <email protected>> Reply-To: tgagne <email protected> NNTP-Posting-Host: p-812.newsdawg.com Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en Xref: spln alt.php:16790

Has anyone noticed httpd children growing continuously with PHP scripts that use domxml? One of our programmers noticed this Friday. He's using the latest php (v *.5??). Maybe it's just us?

-- .tom

Path: spln!rex!extra.newsguy.com!newsp.newsguy.com!news2 From: Thomas Gagne <tgagne <email protected>> Newsgroups: alt.php Subject: Partial Fix: (was Re: Memory leak in domxml?) Date: Tue, 05 Jun 2001 20:19:50 -0400 Organization: eFinNet, Corp. Message-ID: <3B1D7725.911497E <email protected>> References: <3B1A8CD2.8147041D <email protected>> Reply-To: tgagne <email protected> NNTP-Posting-Host: p-905.newsdawg.com Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en Xref: spln alt.php:17061

I have a patch described in:

http://www.php.net/bugs.php?id=11304

that fixes part of the memory leak. There's still another one in there but it doesn't leak nearly as bad. It's caused by the ->children() function (php_if_domxml_children).

-- .tom

Path: spln!rex!extra.newsguy.com!newsp.newsguy.com!news1 From: Thomas Gagne <tgagne <email protected>> Newsgroups: alt.php Subject: Re: Another memory leak fixed Date: Fri, 08 Jun 2001 00:18:27 -0400 Organization: eFinNet, Corp. Message-ID: <3B205213.70F61932 <email protected>> References: <3B1A8CD2.8147041D <email protected>> Reply-To: tgagne <email protected> NNTP-Posting-Host: p-790.newsdawg.com Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.14-5.0 i686) X-Accept-Language: en Xref: spln alt.php:17251

Another bug fixed.

in php_domxml.c (4.0.5), PHP_FUNCTION(domxml_dumpmem), the memory allocated by xmlDocMemoryDump(), must be freed. Problem is, the RETURN_STRINGL macro defined in Zend/zend_API.h doesn't release the memory.

We create another macro, identical to RETURN_STRINGL, except that it frees the memory pointer before returning.

#define FREE_RETURN_STRINGL(s,l,duplicate) { \ char *__s=(s); int __l=l; \ return_value->value.str.len = __l; \ return_value->value.str.val = (duplicate?estrndup(__s,__l):__s); \ return_value->type = IS_STRING; \ free(s); \ return; \ }

-- .tom

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>