in reply to Out of memory with XML::Parser

Is the $ocontent accumulating throughout the whole parse, or is it occasionally reset, and how big does it get? Maybe XML::Twig (xmltwig.com) would help reduce memory usage (if you can periodically purge what's been parsed so far)? I don't know. I don't know enough about your code or what you're trying to do.

Replies are listed 'Best First'.
Re^2: Out of memory with XML::Parser
by LukeyBoy (Friar) on Sep 14, 2005 at 17:45 UTC
    It's reset at the end of each "object" element in the XML. The objects are about 50-60 kilobytes of Base64-encoded data, and my test file has 400 of these elements. The $ocontent variable is reset at the EndTag event of each object element. I'll take a look at XML::Twig...
Re^2: Out of memory with XML::Parser
by LukeyBoy (Friar) on Sep 14, 2005 at 18:41 UTC
    Twig also explodes, as soon as it hits the first large PCDATA section (the 'object' element).
      When you say "the first large" section, is that on the first object? Does it parse any objects? Are you calling purge or flush after each "object" section?
        Yep, first object element. And I was calling purge after all of the elements... I'm going to try to work it with XML::Parser again for the moment.