You don't give us much to work with. Some code and perhaps the amount of RAM on your system would help.
If you do a straight
XML::Twig->new->parsefile( 'my_big_fat_xml_file.xml');, then the resulting data structure should need somewhere around 20GB. That's why XML::Twig let's you process a file one chunk at a time, and purge the memory when you're done with it.
The README for the module (at least for the latest version) includes links to lots of resources about the module. You could start by looking at xmltwig.com.