0
我試圖用飛碟創建一個非常大的PDF,它似乎內存不足。飛碟(xhtmlrenderer)內存不足
下面是一些堆棧痕跡,這表明飛碟並不是完全可擴展的......或者我做錯了什麼?
java.lang.OutOfMemoryError: Java heap space
at com.sun.org.apache.xerces.internal.util.XMLStringBuffer.append(XMLStringBuffer.java:205)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.refresh(XMLDocumentScannerImpl.java:1520)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.invokeListeners(XMLEntityScanner.java:2070)
at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.scanLiteral(XMLEntityScanner.java:1063)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.scanAttributeValue(XMLScanner.java:974)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanAttribute(XMLNSDocumentScannerImpl.java:460)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:277)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transformIdentity(TransformerImpl.java:637)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:708)
at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:313)
at org.xhtmlrenderer.resource.XMLResource$XMLResourceBuilder.createXMLResource(XMLResource.java:189)
at org.xhtmlrenderer.resource.XMLResource.load(XMLResource.java:71)
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2882)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:597)
at java.lang.StringBuffer.append(StringBuffer.java:329)
at org.xhtmlrenderer.css.newmatch.Matcher$Mapper.mapChild(Matcher.java:385)
at org.xhtmlrenderer.css.newmatch.Matcher.matchElement(Matcher.java:153)
at org.xhtmlrenderer.css.newmatch.Matcher.getMapper(Matcher.java:235)
at org.xhtmlrenderer.css.newmatch.Matcher.getCascadedStyle(Matcher.java:85)
at org.xhtmlrenderer.context.StyleReference.getCascadedStyle(StyleReference.java:199)
at org.xhtmlrenderer.layout.SharedContext.getStyle(SharedContext.java:548)
at org.xhtmlrenderer.layout.SharedContext.getStyle(SharedContext.java:527)
at org.xhtmlrenderer.layout.BoxBuilder.createChildren(BoxBuilder.java:1069)
at org.xhtmlrenderer.layout.BoxBuilder.createChildren(BoxBuilder.java:113)
at org.xhtmlrenderer.render.BlockBox.ensureChildren(BlockBox.java:902)
at org.xhtmlrenderer.layout.BoxBuilder.createChildren(BoxBuilder.java:1115)
at org.xhtmlrenderer.layout.BoxBuilder.createChildren(BoxBuilder.java:113)
at org.xhtmlrenderer.render.BlockBox.ensureChildren(BlockBox.java:902)
at org.xhtmlrenderer.layout.BoxBuilder.createChildren(BoxBuilder.java:1135)
同意..只是希望有一個神奇的藥丸! – pstanton 2010-07-30 04:49:40
@pstanton - 有。它是'-Xmx'選項......或使用64位JVM併購買大量內存。 – 2010-07-30 07:27:54
是完全知道..因爲我的客戶說內存很便宜,編程不是! – pstanton 2010-07-30 07:36:37