in reply to XML::LibXML out of memory
the modules has his own site full of examples: in your specific situation you can profit of the flush or purge XML::Twig methods to free the momeory hold by the Twig til now (they are described in section 4.3 of the XML::Twig tutorial).
See Processing_an_XML_document_chunk_by_chunk(saving memory) and also the Twig quick reference as side read to official CPAN documentation.
Anyway i'm sorry for your 500 Mb of XML.. ;=)
L*
|
|---|