I'm running through a large dataset and am generating/manipulating XML documents for each record. What's happening is that after a while, I get a fatal error saying: Fatal error: Allowed memory size of 167772160 bytes exhausted (tried to allocate 32650313 bytes) Each XML file I generate (an manipulate) can range from just a few megs to upwards of 35 megs. Judging from the error above, it looks like the memory for the DOMDocument objects I instantiate is not getting freed; it just continues to stay in memory until the memory is completely exhausted. The method (in my object) I am using to instantiate a new DOMDocument is as follows: protected function createCleanDomDocument() { /* if(( isset( $this->oDomXPath )) && ( !is_null( $this->oDomXPath ))) { unset( $this->oDomXPath ); } if(( isset( $this->oDomDocument )) && ( !is_null( $this->oDomDocument ))) { unset( $this->oDomDocument ); } */ $this->oDomDocument = new DOMDocument( '1.0', 'iso-8859-1' ); $this->oDomXPath = new DOMXpath( $this->oDomDocument ); } which is used in both the constructor of my object and in a few other places. I would think that when the new DOMDocument is instantiated, the memory used for the old value would get freed. As you can see, I've even tried to unset the variables but that doesn't seem to help matters much, either. Does anyone know how (or even if) I can explicitly free the memory used for the DOMDocument? Any help/advice would be greatly appreciated! thnx, Christoph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php