[ https://issues.apache.org/jira/browse/TIKA-2847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16809316#comment-16809316 ]
Tim Allison commented on TIKA-2847: ----------------------------------- The main {{document.xml}} decompresses to ~100MB...which is not insignificant. Our standard docx parser relies on xmlbeans and DOM and is not the most memory efficient. I was hoping switching to a more recent version of Tika that bundles xerces2 would help, and it didn't. I still hit OOM at -Xmx512m. When I switched to our SAX based docx parser, though, I was able to parse it with -Xmx64m. See the documentation (https://wiki.apache.org/tika/MSOfficeParsers) for how to configure Tika to use the streaming docx parser. Let us know if you have any questions. > OutOfMemoryError - tika1.19.1.jar > --------------------------------- > > Key: TIKA-2847 > URL: https://issues.apache.org/jira/browse/TIKA-2847 > Project: Tika > Issue Type: Bug > Affects Versions: 1.19.1 > Reporter: Ashish Tiwari > Priority: Major > Attachments: testCmplData.docx > > > I am trying to parse a docx file and getting below error. Same issue happens > if i convert attached docx file to a pdf. > Attached pdf file is of 3.7 mb, however i doubt it is related to size of the > file, as i am able to parse a file above 30mb without any issues. > PS : This issue only happens if we have JVM configured to -Xmx512m if i > change value to 1024m it starts working fine. > > {code:java} > Exception in thread "main" java.lang.OutOfMemoryError: Java heap space > at > com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842) > at > com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771) > at > com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) > at > com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213) > at > com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643) > at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3414) > at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1272) > at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1259) > at > org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:345) > at > org.openxmlformats.schemas.wordprocessingml.x2006.main.DocumentDocument$Factory.parse(Unknown > Source) > at > org.apache.poi.xwpf.usermodel.XWPFDocument.onDocumentRead(XWPFDocument.java:178) > at org.apache.poi.ooxml.POIXMLDocument.load(POIXMLDocument.java:184) > at org.apache.poi.xwpf.usermodel.XWPFDocument.<init>(XWPFDocument.java:138) > at > org.apache.poi.xwpf.extractor.XWPFWordExtractor.<init>(XWPFWordExtractor.java:60) > at > org.apache.poi.ooxml.extractor.ExtractorFactory.createExtractor(ExtractorFactory.java:228) > at > org.apache.tika.parser.microsoft.ooxml.OOXMLExtractorFactory.parse(OOXMLExtractorFactory.java:116) > at > org.apache.tika.parser.microsoft.ooxml.OOXMLParser.parse(OOXMLParser.java:110) > at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280) > at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280) > at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:143) > at org.apache.tika.Tika.parseToString(Tika.java:527) > {code} > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)