[#8476] - OutOfMemoryError: Java heap space

Bug report
Project: Severity:
Won't Fix
Component: Reproducibility:
Assigned to:

I have a report and when I try to generate it using Jasper iReport (preview feature) and Jasper server it is not generated. The compiling works, but then when it tries to fill up the report with data, after a while I get the error “Report could not be created correctly: java.lang.OutOfMemoryError: Java heap space.” I investigate the issue and I found out that the problem is in text field ($F{listOfPfDepotsAccount}). If this text field has a longer text (with linebreaks or without linebreaks) then this problem appears.
I attach the jrxml file( repIssue.jrxml) and also the sample.xml which was used to investigate the error. With sample_ok.xml I can generate the report, but with sample_wrong.xml I can't. The process is never ending, as long as the java-heap-space-error occurs.

I investigated using Jasper iReport version 4.1.3 and also 4.8.0, for both versions I get the same issue. I suppose the problem is that the textfield $F{listOfPfDepotsAccount} has not enough space when a longer text is in the datasource and can't increase it. I think this is a bug in Jasper iReport. Can you solve this problem?
The following Errormessage is the one which appears on the Jasper server.

Package icon example_to_sent_jasper_forum.zip3.9 KB
tibor.fueloep's picture
Joined: Sep 9 2016 - 1:45am
Last seen: 2 years 8 months ago



is there a solution?

  • Assigned:nobody» alampitt

Hello. I am having similar issue with Jasper Report Server - java.lang.OutOfMemoryError: Java heap space. This is making the application completely unresponsive.

The issue occurs at multiple locations and logs provided below. I have set the JVM Heap space to 8GB, but still does not help. Please let me know if you have any solutions. Thanks in advance.

java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2786)
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)
at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:263)
at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106)
at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:116)
at java.io.OutputStreamWriter.write(OutputStreamWriter.java:203)
at java.io.Writer.write(Writer.java:140)
at net.sf.jasperreports.engine.export.JRHtmlExporter.exportText(JRHtmlExporter.java:1224)
at net.sf.jasperreports.engine.export.JRHtmlExporter.exportGrid(JRHtmlExporter.java:815)
at net.sf.jasperreports.engine.export.JRHtmlExporter.exportPage(JRHtmlExporter.java:730)
at net.sf.jasperreports.engine.export.JRHtmlExporter.exportReportToWriter(JRHtmlExporter.java:679)
at net.sf.jasperreports.engine.export.JRHtmlExporter.exportReport(JRHtmlExporter.java:389)

JBWEB000236: Servlet.service() for servlet STVPdfServlet threw exception: java.lang.OutOfMemoryError
at java.io.ByteArrayOutputStream.hugeCapacity(ByteArrayOutputStream.java:123) [rt.jar:1.7.0_201]
at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:117) [rt.jar:1.7.0_201]
at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93) [rt.jar:1.7.0_201]
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:153) [rt.jar:1.7.0_201]
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) [rt.jar:1.7.0_201]

  • Resolution:Open» Won't Fix
  • Status:New» Closed

iReport is no longer being developed nor supported. Please use Jaspersoft Studio instead.