|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-04-23 18:57 UTC] scottmac@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 17:00:01 2025 UTC |
Description: ------------ xml_set_object causes memory leak.... in example, an infinite loop i written which should not constantly increase memory... When xml_set_object($this->parser, &$this); is removed, memory leak stops... Reproduce code: --------------- class xml { function __construct() { $this->parser = xml_parser_create(); xml_set_object($this->parser, &$this); } function __destruct() { xml_parser_free($this->parser); } } while (true) { usleep(1000); $x = new xml(); unset($x); } Expected result: ---------------- Nothing should happen .... Actual result: -------------- when below code is run.. memory usage increases 5 MB/s for abount 15 seconds and then: PHP Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 16 bytes) in D:\source\php\include\xml.php on line 18 Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 16 bytes) in D:\source\php\include\xml.php on line 18