I am not surprised you are facing memory issues because 30MB is not by any means a size of a typical XML file. The parser performance degrades with the increase in size of the XML file. Among the parsers themselves, you will see SAX parsers perform quite well when compared with DOM parsers as they don't have to maintain an in-memory image of the XML tree.
If your requirement is to deal with such large XML files, then think of writing a "feeder" framework that walks through big chunks of the input XML stream and feeds them to the parser. Ofcourse with such an additional layer, it may not be trivial to handle validation, cross references etc.
------------------
Ajith Kallambella M. Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.
Co-author of
Java 2 Certification Passport