I have a problem with my XML parser. I need to read and parse a 433kb XML-file and for that, I have written 2 java classes. One class uses SAX and the other JDOM2.
To test, if my class can read the file, I started of by only printing out the root-nodes name.
The problem? Not enough heap space.
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at org.jdom2.input.sax.SAXBuilderEngine.build(SAXBuilderEngine.java:217)
at org.jdom2.input.sax.SAXBuilderEngine.build(SAXBuilderEngine.java:277)
at org.jdom2.input.sax.SAXBuilderEngine.build(SAXBuilderEngine.java:264)
at org.jdom2.input.SAXBuilder.build(SAXBuilder.java:1116)
at xmlparser.version.one.ReadXML.main(ReadXML.java:20)
I already read a lot of ideas on stackoverflow and other platforms and used them.
So far I have made sure, that my eclipse uses the 64bit JRE, I have made sure my environment-variables point to the 64bit JRE. I also tried to extend the maximum memory available to eclipe in the eclipse.ini. I have tried setting the available memory for the class itself to this: -Xms512M -Xmx1024M Though 1024M is not enough. so I need to set it to 2048, preferable to 4096 just to be sure.
It still doesn't work, now it gives me this error:
Error occurred during initialization of VM Could not reserve enough space for object heap
I have a 64bit System, i3 dual-core with 16GB DDR3 RAM of which at this moment 11.2GB are available.
I am out of ideas, can anyone help?
