php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41479 Memory Leaks when creating a DOMDocument
Submitted: 2007-05-23 21:11 UTC Modified: 2007-05-28 15:16 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: cmmtch at rit dot edu Assigned:
Status: Not a bug Package: DOM XML related
PHP Version: 5.2.2 OS: SunOS 5.10 sparc
Private report: No CVE-ID: None
 [2007-05-23 21:11 UTC] cmmtch at rit dot edu
Description:
------------
Every time you create a new DOMDocument, even if you unset it directly afterwards, a small amount of memory is leaked.

Reproduce code:
---------------
<?php
while(true){
 $doc = new DOMDocument();
 unset($doc);
}
?>


Expected result:
----------------
Check the memory usage after a few seconds and notice it will go up dramatically. 

Actual result:
--------------
When checking how much memory is used by this process, it will go up with time, even though no variables are being left unset. This means that every time a new DOMDocument is constructed, it allocates more memory than it's destructor is handling. This can be very bad when creating lots of DOMDocuments within a single process.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-25 19:41 UTC] cmmtch at rit dot edu
This was actually do to xdebug
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 28 23:01:27 2024 UTC