in reply to XML::LibXML out of memory

How much memory does your machine have and do you use a 64bit Perl?

32bit Perl is restricted to use at most 4GB of RAM, which doesn't leave much room for actual data with a 500MB XML file.

The "huge" option only relaxes some hardcoded limits within XML::LibXML, likely to protect against attacks like the Billion laughs attack.

Maybe you have better luck with XML::Twig instead of XML::LibXML, as XML::Twig will not read the complete input file at once and construct the representation in memory.