So it is clear that PHP allocate about 150kB (what is size of file) of memory after reading HTML file to $doc variable and then another 150kB after parsing file for new XHTML file (which is stored within object's variable $xhtml). It's logical but how to free this memory after I don't need neither $doc variable nor parser object? Unsetting the variable or object doesn't help. Thanks,
Lubos
Just an dirty idea, but if you can run PHP5 you may extend the needed classes and call __destruct() yourself? Dont forget remember that the subclasses constructor need to pass the arguments to parent::Class_Name($arg1,$arg2,..$argn);