JRPdfExporter causing OOME Java heap space

0

Dear community, 

I am using JRSwapFileVirtualizer for large datasets from the Oracle database, reports are filled by SQL query. 
JasperFillManager.fillReport ends successfully, jasperPrint is created and JRSwapFileVirtualizer is used properly. 

In the report design, I have got a table dataset, with 8 grouping criteria. When It comes to generating report PDF, I have got a java.lang.OutOfMemoryError: Java heap space:

  java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
    at com.lowagie.text.pdf.ByteBuffer.append_i(Unknown Source)
    at com.lowagie.text.pdf.ByteBuffer.append(Unknown Source)
    at com.lowagie.text.pdf.ByteBuffer.formatDouble(Unknown Source)
    at com.lowagie.text.pdf.ByteBuffer.append(Unknown Source)
    at com.lowagie.text.pdf.ByteBuffer.append(Unknown Source)
    at com.lowagie.text.pdf.PdfContentByte.setLineCap(Unknown Source)
    at net.sf.jasperreports.engine.export.JRPdfExporter.preparePen(JRPdfExporter.java:3147)
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportBottomPen(JRPdfExporter.java:3038)
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportBox(JRPdfExporter.java:2891)
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportFrame(JRPdfExporter.java:3386)
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:1108)
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportFrame(JRPdfExporter.java:3379)
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:1108)
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:1063)
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:927)
    at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:547)

Points from my investigation:
- XLS export works just fine
- When I remove all the grouping + sum variables, PDF works fine and all 3900 pages are printed
- When I increase JVM memory, the report is generated but pdf is still corrupted and only first page works without lags

I have found few similar issues on the internet, but not the solution.

Anyone can help me please?

Kind regards,

Jan

might be related to this topic:

https://community.jaspersoft.com/questions/1155731/export-report-pdf-format
https://community.jaspersoft.com/questions/525206/exportreporttopdffile-hangs-outofmemoryerror
https://community.jaspersoft.com/questions/1163006/could-not-load-following-font

honza.brtek's picture
Joined: Mar 31 2017 - 7:18am
Last seen: 1 month 3 weeks ago

1 Answer:

0

Update 1: When I remove half of the grouping, the PDF is generated without java heap error , but its incredible laggy. 

 

Any help anyone?

honza.brtek's picture
Joined: Mar 31 2017 - 7:18am
Last seen: 1 month 3 weeks ago
Feedback