Re: Out of Memory problem
I tried to increase memory of JVM through Tomcat - but not much change. I believe the way i am using my procedure (creating objects) that might be wrong. Below is some statistics (logger is displaying) when i am trying to render the PDF with 1 page / 2 pages / 3 pages etc 1 page report 2 pages report 3 pages report Initial Heap size ~ 12M 14M 10M Current Heap size ~ 64M 10M 9M Total memory used~ 52M 4M -1M If i try for 4 pages report then i get OutOfMemory Error. Once i get this error then even sometimes iget errors for 2 pages / 3pages report too. Total memory used always go in -ve later. I am attaching my procedure below which i use to render the pdf -- //Following method is used to render PDFpublic synchronized void renderPDF (...) throws Exception { ... get xsl file path get xml org.apache.fop.image.FopImageFactory.resetCache(); //get the user config file for pdf Arial unicode font File userConfigFile = new File(cnffilepath); Options options = new org.apache.fop.apps.Options(userConfigFile); TraxInputHandler xsltinput = new TraxInputHandler(new File(xmlpath), new File(xslpath));ByteArrayOutputStream outputPDFBuffer = new ByteArrayOutputStream();Driver driver = new Driver(); driver.setLogger(new org.apache.avalon.framework.logger.Log4JLogger(logger) );driver.setRenderer(Driver.RENDER_PDF);driver.setOutputStream(outputPDFBuffer);xsltinput.run(driver);FileOutputStream pdfDoc = new FileOutputStream(pdfpath);pdfDoc.write(outputPDFBuffer.toByteArray(), 0, outputPDFBuffer.size());pdfDoc.flush();pdfDoc.close();}//renderPDF- regards Manisha Chris Bowditch [EMAIL PROTECTED] wrote: Manisha Sathe wrote: Thanks Chris, Would appreciate if u can explain more how shall i increase memory in my case - I am on Tomcat server and using servlet to render the fop. I am not using fop.bat file, Which script starts my JVM - really speaking i also do not know.Well I havent used Tomcat, but I know it will be started by a shell script or batch file. You will need to find it and add the parameter -Xmx256M to the call to java. Ask on a tomcat specific list, this is getting somewhat off topic for FOP/XSL-FO.Chris__Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Out of Memory problem
Can you send your xml and xsl file ? Ashish - Original Message - From: Manisha Sathe To: [EMAIL PROTECTED] Sent: 28 February, 2005 09:32 Subject: Re: Out of Memory problem I tried to increase memory of JVM through Tomcat - but not much change. I believe the way i am using my procedure (creating objects) that might be wrong. Below is some statistics (logger is displaying) when i am trying to render the PDF with 1 page / 2 pages / 3 pages etc 1 page report 2 pages report 3 pages report Initial Heap size ~ 12M 14M 10M Current Heap size ~ 64M 10M 9M Total memory used~ 52M 4M -1M If i try for 4 pages report then i get OutOfMemory Error. Once i get this error then even sometimes iget errors for 2 pages / 3pages report too. Total memory used always go in -ve later. I am attaching my procedure below which i use to render the pdf -- //Following method is used to render PDFpublic synchronized void renderPDF (...) throws Exception { ... get xsl file path get xml org.apache.fop.image.FopImageFactory.resetCache(); //get the user config file for pdf Arial unicode font File userConfigFile = new File(cnffilepath); Options options = new org.apache.fop.apps.Options(userConfigFile); TraxInputHandler xsltinput = new TraxInputHandler(new File(xmlpath), new File(xslpath));ByteArrayOutputStream outputPDFBuffer = new ByteArrayOutputStream();Driver driver = new Driver(); driver.setLogger(new org.apache.avalon.framework.logger.Log4JLogger(logger) );driver.setRenderer(Driver.RENDER_PDF);driver.setOutputStream(outputPDFBuffer);xsltinput.run(driver);FileOutputStream pdfDoc = new FileOutputStream(pdfpath);pdfDoc.write(outputPDFBuffer.toByteArray(), 0, outputPDFBuffer.size());pdfDoc.flush();pdfDoc.close();}//renderPDF- regards Manisha Chris Bowditch [EMAIL PROTECTED] wrote: Manisha Sathe wrote: Thanks Chris, Would appreciate if u can explain more how shall i increase memory in my case - I am on Tomcat server and using servlet to render the fop. I am not using fop.bat file, Which script starts my JVM - really speaking i also do not know.Well I havent used Tomcat, but I know it will be started by a shell script or batch file. You will need to find it and add the parameter -Xmx256M to the call to java. Ask on a tomcat specific list, this is getting somewhat off topic for FOP/XSL-FO.Chris __Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Re: Out of Memory problem
i am generating xml file on fly. Giving one sample of xml. Pls ignore chinese characters (copied any dummy things inside), Iam usingArial Unicode MS font. regards ManishaAshish [EMAIL PROTECTED] wrote: Can you send your xml and xsl file ? Ashish - Original Message - From: Manisha Sathe To: [EMAIL PROTECTED] Sent: 28 February, 2005 09:32 Subject: Re: Out of Memory problem I tried to increase memory of JVM through Tomcat - but not much change. I believe the way i am using my procedure (creating objects) that might be wrong. Below is some statistics (logger is displaying) when i am trying to render the PDF with 1 page / 2 pages / 3 pages etc 1 page report 2 pages report 3 pages report Initial Heap size ~ 12M 14M 10M Current Heap size ~ 64M 10M 9M Total memory used~ 52M 4M -1M If i try for 4 pages report then i get OutOfMemory Error. Once i get this error then even sometimes iget errors for 2 pages / 3pages report too. Total memory used always go in -ve later. I am attaching my procedure below which i use to render the pdf -- //Following method is used to render PDFpublic synchronized void renderPDF (...) throws Exception { ... get xsl file path get xml org.apache.fop.image.FopImageFactory.resetCache(); //get the user config file for pdf Arial unicode font File userConfigFile = new File(cnffilepath); Options options = new org.apache.fop.apps.Options(userConfigFile); TraxInputHandler xsltinput = new TraxInputHandler(new File(xmlpath), new File(xslpath));ByteArrayOutputStream outputPDFBuffer = new ByteArrayOutputStream();Driver driver = new Driver(); driver.setLogger(new org.apache.avalon.framework.logger.Log4JLogger(logger) );driver.setRenderer(Driver.RENDER_PDF);driver.setOutputStream(outputPDFBuffer);xsltinput.run(driver);FileOutputStream pdfDoc = new FileOutputStream(pdfpath);pdfDoc.write(outputPDFBuffer.toByteArray(), 0, outputPDFBuffer.size());pdfDoc.flush();pdfDoc.close();}//renderPDF- regards Manisha Chris Bowditch [EMAIL PROTECTED] wrote: Manisha Sathe wrote: Thanks Chris, Would appreciate if u can explain more how shall i increase memory in my case - I am on Tomcat server and using servlet to render the fop. I am not using fop.bat file, Which script starts my JVM - really speaking i also do not know.Well I havent used Tomcat, but I know it will be started by a shell script or batch file. You will need to find it and add the parameter -Xmx256M to the call to java. Ask on a tomcat specific list, this is getting somewhat off topic for FOP/XSL-FO.Chris __Do You Yahoo!?Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com Do you Yahoo!? Yahoo! Sports - Sign up for Fantasy Baseball.?xml version=1.0 encoding=UTF-8? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:fo=http://www.w3.org/1999/XSL/Format; xsl:template match=Advertisement fo:root xmlns:fo=http://www.w3.org/1999/XSL/Format; fo:layout-master-set fo:simple-page-master master-name=advertisement page-height=29.7cm page-width=22cm margin-top=2cm margin-bottom=2cm margin-left=2.0cm margin-right=2.0cm fo:region-body margin-top=0cm/ fo:region-before extent=0cm/ fo:region-after extent=1cm/ /fo:simple-page-master /fo:layout-master-set xsl:apply-templates select=AdvertPage/ /fo:root /xsl:template xsl:template match=AdvertPage fo:page-sequence master-reference=advertisement fo:flow flow-name=xsl-region-body fo:table table-layout=fixed fo:table-column column-width=18cm / fo:table-body fo:table-row fo:table-cell display-align=center background-color=rgb(0, 0, 0) border-collapse=collapse border-style=solid border-width=thick fo:block text-align=center color=rgb(256, 256, 256) fo:external-graphic src=url('file:D:\jakarta-tomcat-5.0.25\webapps\sbcs\jsps\images\advert_ch_hdr.jpg')//fo:block /fo:table-cell /fo:table-row /fo:table-body /fo:table fo:table table-layout=fixed fo:table-column column-width=5cm / fo:table-column column-width=4cm / fo:table-column column-width=4cm / fo:table-column column-width=5cm / fo:table-body fo:table-row height=1cm fo:table-cell display-align=center border-collapse=collapse border-style=solid border-width=thick fo:block text-align=centerfo:inline font-family=arialuni#32852;#36187;/fo:inline/fo:block /fo:table-cell fo:table-cell display-align=center border-collapse=collapse border-style=solid border-width=thick fo:block text-align=centerfo:inline font-family=arialuni#20027;#38431;/fo:inline/fo:block /fo:table-cell fo:table-cell display-align=center border-collapse=collapse border-style=solid border-width=thick fo:block text-align=centerfo:inline
barcode4j NoSuchMethod Exception
Dear all, i tried to implement the barcode4j tools but was not succesfull. After copying the appropriate jars to the libdir and applying changes to the cp I get the following error: Exception in thread main java.lang.NoSuchMethodError: org.apache.avalon.framew ork.configuration.DefaultConfiguration.init(Ljava/lang/String;)V at org.krysalis.barcode4j.tools.ConfigurationUtil.processElement(Configu rationUtil.java:86) at org.krysalis.barcode4j.tools.ConfigurationUtil.processNode(Configurat ionUtil.java:72) at org.krysalis.barcode4j.tools.ConfigurationUtil.buildConfiguration(Con figurationUtil.java:49) at org.krysalis.barcode4j.fop0205.BarcodeElement.layout(BarcodeElement.j ava:187) at org.apache.fop.fo.flow.InstreamForeignObject.layout(InstreamForeignOb ject.java:251) at org.apache.fop.fo.flow.Block.layout(Block.java:257) at org.apache.fop.fo.flow.Block.layout(Block.java:257) at org.apache.fop.fo.flow.AbstractFlow.layout(AbstractFlow.java:154) at org.apache.fop.fo.flow.AbstractFlow.layout(AbstractFlow.java:110) at org.apache.fop.fo.pagination.PageSequence.makePage(PageSequence.java: 400) at org.apache.fop.fo.pagination.PageSequence.format(PageSequence.java:33 8) at org.apache.fop.apps.StreamRenderer.render(StreamRenderer.java:262) at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:223) at org.apache.xalan.transformer.ResultTreeHandler.endElement(Unknown Sou rce) at org.apache.xalan.templates.ElemLiteralResult.execute(Unknown Source) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Un known Source) at org.apache.xalan.templates.ElemLiteralResult.execute(Unknown Source) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(Un known Source) at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(Unkn own Source) at org.apache.xalan.transformer.TransformerImpl.transformNode(Unknown So urce) at org.apache.xalan.transformer.TransformerImpl.run(Unknown Source) at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(Unkno wn Source) at org.apache.xerces.parsers.AbstractSAXParser.endDocument(Unknown Sourc e) at org.apache.xerces.impl.XMLDocumentScannerImpl.endEntity(Unknown Sourc e) at org.apache.xerces.impl.XMLEntityManager.endEntity(Unknown Source) at org.apache.xerces.impl.XMLEntityManager$EntityScanner.load(Unknown So urce) at org.apache.xerces.impl.XMLEntityManager$EntityScanner.skipSpaces(Unkn own Source) at org.apache.xerces.impl.XMLDocumentScannerImpl$TrailingMiscDispatcher. dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Un known Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xalan.transformer.TrAXFilter.parse(Unknown Source) at org.apache.fop.apps.Driver.render(Driver.java:498) at org.apache.fop.apps.CommandLineStarter.run(CommandLineStarter.java:10 6) at org.apache.fop.apps.Fop.main(Fop.java:62) I googled alot but dont know how to start with this issue. Any help appreciated, thanks David - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: barcode4j NoSuchMethod Exception
Hi David, you most probably overlooked an item in [1]. From that page: Important: When you use FOP 0.20.5 together with Barcode4J, make sure you use the version of Avalon Framework that comes with Barcode4J (or the latest release of Avalon Framework). The version from FOP is slightly out-of-date. [1] http://barcode4j.krysalis.org/fop-ext.html I hope that helps. On 28.02.2005 12:07:43 David Preuss wrote: Dear all, i tried to implement the barcode4j tools but was not succesfull. After copying the appropriate jars to the libdir and applying changes to the cp I get the following error: Exception in thread main java.lang.NoSuchMethodError: org.apache.avalon.framew ork.configuration.DefaultConfiguration.init(Ljava/lang/String;)V at snip/ I googled alot but dont know how to start with this issue. Any help appreciated, Jeremias Maerki - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Upper Limit on XML File Size?
Hello, Apologize for posting this in the FOP Forum..but does anyone know if there any Upper Limit on the Size of the XML File that can be Processed by the Xalan XSLT Processor? I am having trouble generating simple FO Objects for XML Files which are over 50 MB. I dont get any error messages.but when i observe the FO output file..I can see that it has not Transformed the entire XML File. Any help here is greatly appreciated. Thanks Ram __ Do you Yahoo!? Yahoo! Mail - Easier than ever with enhanced search. Learn more. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Upper Limit on XML File Size?
Ram Krishnamoorthi wrote: Apologize for posting this in the FOP Forum..but does anyone know if there any Upper Limit on the Size of the XML File that can be Processed by the Xalan XSLT Processor? I am having trouble generating simple FO Objects for XML Files which are over 50 MB. I dont get any error messages.but when i observe the FO output file..I can see that it has not Transformed the entire XML File. The maximal input file size is mostly determined by the available memory, and to some extent by the complexity off the transformation and output handling. Xalan (as well as most other XSLT processors, most of the time) reads the complete input into memory and builds an internal data structure for processing. As a rule of thumb, JVM memory to input files size is 10:1 (unless recent releases improved significantly), i.e. a 50MB input will need around 500MB JVM heap size for holding the input. The transformation also uses memory, especially building RTF variables, recursive templates for complex string manipulation, large key tables, XPath expressions which select a significant part of the input but not a whole subtree and Muenchean grouping can eat a lot of additional memory. If you serialize the output, this is usually streamed, but if you want to process the result further, you'll need even more ressources.. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Upper Limit on XML File Size?
Thanks Jan for the Response My Largest XML File is about 65 MB. I am allocating a Heap Size of 2 GB and still not able to Transform the Entire File. I can see that the Java Process performing the Transformation uses about 1.7 GB during the Transformation..and my Stylesheet does not have any Fancy Transformation, all it does is apply the same Template repeatedly..No Tables or Images included as well. Increasing the Max Heap Size beyond 2 GB didnt help either. Is there someother Memory setting that should be hiked? Thanks again --- J.Pietschmann [EMAIL PROTECTED] wrote: Ram Krishnamoorthi wrote: Apologize for posting this in the FOP Forum..but does anyone know if there any Upper Limit on the Size of the XML File that can be Processed by the Xalan XSLT Processor? I am having trouble generating simple FO Objects for XML Files which are over 50 MB. I dont get any error messages.but when i observe the FO output file..I can see that it has not Transformed the entire XML File. The maximal input file size is mostly determined by the available memory, and to some extent by the complexity off the transformation and output handling. Xalan (as well as most other XSLT processors, most of the time) reads the complete input into memory and builds an internal data structure for processing. As a rule of thumb, JVM memory to input files size is 10:1 (unless recent releases improved significantly), i.e. a 50MB input will need around 500MB JVM heap size for holding the input. The transformation also uses memory, especially building RTF variables, recursive templates for complex string manipulation, large key tables, XPath expressions which select a significant part of the input but not a whole subtree and Muenchean grouping can eat a lot of additional memory. If you serialize the output, this is usually streamed, but if you want to process the result further, you'll need even more ressources.. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - Easier than ever with enhanced search. Learn more. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Upper Limit on XML File Size?
Ram Krishnamoorthi wrote: My Largest XML File is about 65 MB. I am allocating a Heap Size of 2 GB and still not able to Transform the Entire File. I can see that the Java Process performing the Transformation uses about 1.7 GB during the Transformation..and my Stylesheet does not have any Fancy Transformation, all it does is apply the same Template repeatedly..No Tables or Images included as well. I'm confused. XSLT is not about tables or images. Increasing the Max Heap Size beyond 2 GB didnt help either. The Sun JVM has a hard upper limit, which used to be 1G for heap and another one for the stack. If the XSLT processor really runs out of memory, you should get a notice somewhere. Maybe somewhere where you didn't look yet. Some questions: - What JVM are you using? Which version? - What Xalan release are you using? How do you know you are really using this release? - How do you run the XSLT processor? Command line? Embedded? - Are you sure you really mean you are running only the transformation? - How do you handle the output? Ordinary serializing to a file? You might also investigate in using a memory profiler (I like DrMem - small, free, easy to use), or asking on the Xalan user list. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Upper Limit on XML File Size?
I am calling the Transformation from the command line and attempting to create a FO Object xalan.sh -IN XMLFile -XSL XSLFile -OUT FOFileName I am using JDK 1.4 The Xalan Version is an older one. java rg.apache.xalan.processor.XSLProcessorVersion Xalan Java 2.2.D11 Thanks Jan ..I am now looking at the MulberryTech XSLT Forum as well. --- J.Pietschmann [EMAIL PROTECTED] wrote: Ram Krishnamoorthi wrote: My Largest XML File is about 65 MB. I am allocating a Heap Size of 2 GB and still not able to Transform the Entire File. I can see that the Java Process performing the Transformation uses about 1.7 GB during the Transformation..and my Stylesheet does not have any Fancy Transformation, all it does is apply the same Template repeatedly..No Tables or Images included as well. I'm confused. XSLT is not about tables or images. Increasing the Max Heap Size beyond 2 GB didnt help either. The Sun JVM has a hard upper limit, which used to be 1G for heap and another one for the stack. If the XSLT processor really runs out of memory, you should get a notice somewhere. Maybe somewhere where you didn't look yet. Some questions: - What JVM are you using? Which version? - What Xalan release are you using? How do you know you are really using this release? - How do you run the XSLT processor? Command line? Embedded? - Are you sure you really mean you are running only the transformation? - How do you handle the output? Ordinary serializing to a file? You might also investigate in using a memory profiler (I like DrMem - small, free, easy to use), or asking on the Xalan user list. J.Pietschmann - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] __ Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less. http://info.mail.yahoo.com/mail_250 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]