Jump to content
We've recently updated our Privacy Statement, available here ×

subreport out of memory - can't recreate in dev


rcmpjames

Recommended Posts

Greetings,

 

I am getting the following stack trace in a PROD environment, but cannot recreate in my DEV (with same data), so I assume it is not related to the "known" issue of the subreports extending beyond their boundaries within their respoective parents. Any other ideas? JasperReports has been rendered useless in our PROD environment...

 

java.lang.OutOfMemoryError

NESTED BY :net.sf.jasperreports.engine.JRRuntimeException at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:583) at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:345) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:311) at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:275) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1307) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:631) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:228) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:128) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:750) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:666) at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:498) at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:63) at net.sf.jasperreports.engine.fill.JRThreadSubreportRunner.run(JRThreadSubreportRunner.java:137) at java.lang.Thread.run(Thread.java:534)Caused by: java.lang.OutOfMemoryError

Link to comment
Share on other sites

  • Replies 11
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

The only time I have seen a subreport overflow is when a subreport is placed in the "LastPageFooter" band (this band has no-where to grow too so if the subreport grows larger than the band the report breaks).

 

Can you paste the entire stack trace?

Link to comment
Share on other sites

I have worked with some very large reports and not had issues.

 

When the report is filling with data, the pages are built/stored in memory. For larger reports (more data) you sometimes have to implement a virtualizer (this moves some of the page data from memory to the file system).

 

This is something you might want to look into, but I don't think it is the issue here.

 

However I think this probably is the result of something in your report design. A loop perhaps that is consuming all the memory. Why this doesn't happen on your machine I don't know.

 

Can you post the JRXML for the subreport?

Link to comment
Share on other sites

Dumb Question:

 

When I render the report, I send a byteArray to a struts forward that I get from a JRExporter's Output Stream - like this:

 

Code:

...

JRExporter exporter = new JRPdfExporter();
exporter.setParameter(JRExporterParameter.JASPER_PRINT, printer);
exporter.setParameter(JRExporterParameter.OUTPUT_STREAM, buf);
exporter.exportReport();

request.setAttribute( "GeneratedReport", buf.toByteArray());

...

 

Might this ByteArray be the problem?

Link to comment
Share on other sites

This is very weird.

 

So this happens every time? You never posted the JRXML. What I was going to look for was passed in values in the query that, when given a certain value, could result in a issue at the query level. Also for Subreports in bands that don't allow for overflows (ie: LastPageFooter).

 

You might want to consider turning on debugging in log4J for the JR JDBC QueryExcuter and the Exporter you are using. You might get a better clue as to what is going on from those outputs.

 

I am not sure where to go from here as I have a few "weird" issues of my own to solve.

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...