Hi,
Can anybody plz help me out with this Exception.
The application converts a XML to PDF with the help of dynamicPDF.jar. I am getting exception at dra() method of Document class. Please find the details below.
SEVERE: Servlet.service() for servlet downloadPDFServlet threw exception
java.lang.OutOfMemoryError: Java heap space
at com.cete.dynamicpdf.text.s.encode(Unknown Source)
at com.cete.dynamicpdf.io.OperatorWriter.write_Tj_(Unknown Source)
at com.cete.dynamicpdf.text.TextLineList.d(Unknown Source)
at com.cete.dynamicpdf.text.TextLineList.draw(Unknown Source)
at com.cete.dynamicpdf.pageelements.Label.drawRotated(Unknown Source)
at com.cete.dynamicpdf.pageelements.RotatingPageElement.draw(Unknown Source)
at com.cete.dynamicpdf.pageelements.Group.draw(Unknown Source)
at com.cete.dynamicpdf.Page.drawAppend(Unknown Source)
at com.cete.dynamicpdf.Page.drawEntries(Unknown Source)
at com.cete.dynamicpdf.Page.draw(Unknown Source)
at com.cete.dynamicpdf.io.SinglePassDocumentWriter.f(Unknown Source)
at com.cete.dynamicpdf.io.SinglePassDocumentWriter.draw(Unknown Source)
at com.cete.dynamicpdf.Document.draw(Unknown Source)
at InvoiceFormatter.B2BMultilineInvoiceFormatter.action(B2BMultilineInvoiceFormatter.java:262)
at downloadPDFServlet.doGet(downloadPDFServlet.java:78)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:228)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:216)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:634)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:445)
at java.lang.Thread.run(Thread.java:619)
Out of Memory Exception with dynamicPDF.jar
Re: Out of Memory Exception with dynamicPDF.jar
Support · Nov 13, 2008Hello,
A possible problem with the OutOfMemoryError could be that you are running out of Virtual Memory. Try increasing the Maximum heap size value and running the application again and see if you still get the error. Following is the command line syntax to increase the Virtual Memory size: java -Xms512m -Xmx512m <javaclassname>.
As a general rule, set minimum heap size (-Xms) equal to the maximum heap size (-Xmx) to minimize garbage collections.
Thanks,
ceTe Software Support Team.
Re: Out of Memory Exception with dynamicPDF.jar
Forum member · Nov 13, 2008Hi,
Thanks for your quick response.
Well the thing is we are using weblogic application server and the Heap memory for admin server and portal instance is set to 1024MB with -Xmx as well as -Xms options.
As the number of users who are accessing the same page of portal increases the server crashes. Also for your information, the PDF which is getting generated is of Size 3.5 to 4 MB and we are providing option for to open or download the same.
Are there any chances of memory leaks in servlet code??? OR
do we need any specific settings at weblogic end??
Thanks and Regards,
Navin
Re: Out of Memory Exception with dynamicPDF.jar
Support · Nov 13, 2008Hello Navin,
We are able to generate very large PDF documents using our product without any problem. We have generated 300MB and more sized PDFs without any problem.
We are not aware of any specific settings on weblogic. You can send the code you are using to our [^a|mailto:support@cete.com|Support Team^] so that they can take a look into it to find out if any memory leaks are there.
Thanks,
ceTe Software Support Team.