views:

47

answers:

1

Hi I was working with apache fop and when the number of pages exceeds about 130 pages ,it could not generate the pdf .... Is there any limit to page number or the length of xml file...

Exception in thread "main" java.lang.OutOfMemoryError: Java heap

space at java.io.BufferedReader.(BufferedReader.java:80) at java.io.BufferedReader.(BufferedReader.java:91) at org.apache.xml.dtm.ObjectFactory.findJarServiceProviderName(ObjectFac tory.java:579) at org.apache.xml.dtm.ObjectFactory.lookUpFactoryClassName(ObjectFactory .java:373) at org.apache.xml.dtm.ObjectFactory.lookUpFactoryClass(ObjectFactory.jav a:206) at org.apache.xml.dtm.ObjectFactory.createObject(ObjectFactory.java:131)

        at org.apache.xml.dtm.ObjectFactory.createObject(ObjectFactory.java:101)

        at org.apache.xml.dtm.DTMManager.newInstance(DTMManager.java:135)
        at org.apache.xpath.XPathContext.reset(XPathContext.java:350)
        at org.apache.xalan.transformer.TransformerImpl.reset(TransformerImpl.ja
va:505)
        at org.apache.xalan.transformer.TransformerImpl.transformNode(Transforme
rImpl.java:1436)
        at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp
l.java:709)
        at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp
l.java:1284)
        at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImp
l.java:1262)
        at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:214)
        at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:125)
        at org.apache.fop.cli.Main.startFOP(Main.java:166)
        at org.apache.fop.cli.Main.main(Main.java:197)
+1  A: 

I've created reports that are made from xmls that were several hundred thousand lines long. However I have had some issues creating smaller reports filled with svgs.

Your issue is probably that java by default only allocates 32 MB memory (if I recall correctly) so it's running out of memory.

In the fop.bat file (assumimg you're running on windows) add the following setting

rem Increase standard Java VM heap size, so that bigger reports get enough memory set JAVAOPTS=-Xmx512M

and alter the execution line as follows

"%JAVACMD%" %JAVAOPTS% %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS%

This should work with 0.95 at least

Crocked
Or if launching from a java application simply add this to the command prompt when launching
Crocked