I'm facing a problem while reading large XML files "100 MB" and parsing it using xstream always the below error occurs
java.lang.OutOfMemoryError: Java heap space error occurs,
here is the code that parses the XML
XStream xstream = new XStream(); xstream.processAnnotations(Class.forName((String)ClassName));
ClassName is a normal class that have the fields with xml annotations.
then use
Object resultDto = xstream.fromXML((String)fileString);
fileString: is the xml file after reading it as inputstream and put it in string buffer.
the above code works fine with small files but didn't work with the big one, any ideas please?