[PHP-DEV] Re: Bug #11304 Updated: memory leak

2001-07-17 Thread Thomas Gagne

No, but it doesn't take much (I'm more of a C programmer than a PHP
programmer).  Just write a
script that uses the same variable and keep assigning it new XML documents.
You'll memory
keeps getting bigger and bigger until the system falls apart.  This is what
happens when php runs under Apache.  To test it in stand alone mode (which is
how we debugged it) just put the
assignment in a loop.  It only took our system 10 seconds or so to break.

PS.  I forgot my password so I couldn't update the database.  When I asked it
to mail me my password it told me it was empty--but that doesn't work either.
I'll have to wait until I get my Visor back to discover what the password is
(if I set one--I don't remember).

--
.tom




-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] [Fwd: Memory leak in domxml?]

2001-06-22 Thread Thomas Gagne

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 [EMAIL PROTECTED]
Newsgroups: alt.php
Subject: Memory leak in domxml?
Date: Sun, 03 Jun 2001 15:15:31 -0400
Organization: eFinNet, Corp.
Message-ID: [EMAIL PROTECTED]
Reply-To: [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 [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: [EMAIL PROTECTED]
References: [EMAIL PROTECTED]
Reply-To: [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 [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: [EMAIL PROTECTED]
References: [EMAIL PROTECTED]
Reply-To: [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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]