in reply to XML::Twig loves to eat my memory

I'm not an expert dealing with XML::Twig I usually use XML::Simple but anyway, reading the docs I think you might need to use the flush method too not only the dispose

You might need something like $BIOG->flush; inside your BIOG subroutine