| 
        php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             
             [2007-05-25 19:41 UTC] cmmtch at rit dot edu
  | 
    |||||||||||||||||||||||||||||||||||||
            
                 
                Copyright © 2001-2025 The PHP GroupAll rights reserved.  | 
        Last updated: Tue Nov 04 06:00:01 2025 UTC | 
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.