domxml close document routine
| From: | Robert Oldham | Date: | Sun, 23 Feb 2003 01:40:00 +0000 |
| Subject: | domxml close document routine | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-94481@lists.php.net to get a copy of this message | ||
Overview:
domxml does not include a close document routing to release memory after
an xml document has been processed. I have added one.
Purpose:
I am using PHP's domxml functionality to parse thousands (17,000+) xml
documents in a single request. The current implementation of domxml in
PHP does not allow for xml documents to be closed, so memory is lost at
more than 7KB/document during processing. I have been able to reduce
this to 1KB/document by adding a close document routine to the PHP
domxml extension and calling that close routine in my PHP scripts.
Diff:
Please see the patch files for my changes at the following URLs.
http://robertoldham.com/php_domxml.h.php4.diff
http://robertoldham.com/php_domxml.c.php4.diff
http://robertoldham.com/php_domxml.h.php5.diff
http://robertoldham.com/php_domxml.c.php5.diff
Caveats:
Lacking familiarity with PHP development, I am not sure that my
implementation of the close routine is optimal. However, I have been
using this code change in php-4.2.3, php-4.3.0 and php-4.3.1 for
approximately 6 weeks without any problems.
I am also unfamiliar with the process of getting a change reviewed and
applied. If I have done anything wrong, or need to do additional things
to follow this through, please let me know.
Thank you,
Robert Oldham