Jump to content

java.lang.OutOfMemoryError when compiling recursive subreport


mtassinari

Recommended Posts

Hi everybody,

I'm opening this thread to ask for some help in printing a particular report created using JasperReports.

This report needs to print a tree-like structure, which has no fixed deepness, so I created it as a report which recursively calls itself changing only the father node ID.

The problem is, when I try to compile/execute the report, I get an error saying

java.lang.OutOfMemoryError: unable to create new native thread

I'm not sure this is actually caused by JasperReports, what I've done was monitoring the memory usage, but it NEVER hit the maximum java heap size, which is set to 1.5 GB, in fact it blocked at about 210 MB.

Any ideas on how to solve this?

Thanks in advance.



Post Edited by mtassinari at 05/21/2012 09:00
Link to comment
Share on other sites

  • 6 years later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hello. I am having similar issue with Jasper Report Server - java.lang.OutOfMemoryError: Java heap space, on upgrading to Jasper Report 6.5.1.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]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...