All,
I am not a java developer, but I am using a java code that was available online to convert a large XML file to CSV file. The input file size is big, it is around 3GB. I got an error that it is out of memory, it is expectedly due to the large input file that i am trying to convert. Splitting of this file is not possible, could you suggest any options to work around this problem?
This is what I ran:
xml2csv-conv data.xml data.csv
Error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at com.sun.org.apache.xerces.internal.dom.DeferredDoc umentImpl.createChu
nk(Unknown Source)
at com.sun.org.apache.xerces.internal.dom.DeferredDoc umentImpl.ensureCap
acity(Unknown Source)
at com.sun.org.apache.xerces.internal.dom.DeferredDoc umentImpl.createNod
e(Unknown Source)
at com.sun.org.apache.xerces.internal.dom.DeferredDoc umentImpl.createDef
erredTextNode(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.Abstrac tDOMParser.characte
rs(Unknown Source)
at com.sun.org.apache.xerces.internal.impl.XMLDocumen tFragmentScannerImp
l.scanDocument(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(U
nknown Source)
at com.sun.org.apache.xerces.internal.parsers.XML11Co nfiguration.parse(U
nknown Source)
at com.sun.org.apache.xerces.internal.parsers.XMLPars er.parse(Unknown So
urce)
at com.sun.org.apache.xerces.internal.parsers.DOMPars er.parse(Unknown So
urce)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBu ilderImpl.parse(Unk
nown Source)
at javax.xml.parsers.DocumentBuilder.parse(Unknown Source)
at xml2csvconv.Main.convert(Main.java:194)
at xml2csvconv.Main.main(Main.java:493)
Thanks a ton!
--- Update ---
Additional information: I am running this from a Windows8 64 bit machine with 8GB physical RAM.