in reply to Re^7: XML::Twig loves to eat my memory
in thread XML::Twig loves to eat my memory

It doesn't matter since you're calling dispose, but the relevant test is to call Scalar::Util's weaken

Replies are listed 'Best First'.
Re^9: XML::Twig loves to eat my memory
by carcus88 (Acolyte) on Jul 23, 2010 at 16:33 UTC
    Can you advise me how to use weaken in my example? I Tried to add weaken($t) after calling $t->dispose() but nothing changed, memory use remained the same. I also tried to call weaken($t) after $t= new XML::Twig but that simply made the XML::Twig object break, it failed on the next method call.
      Twig uses weaken so you don't have to call dispose. Don't call weaken. There does appear to be a memory leak, so you should be submitting a bug report.