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

Virtualizer + PDF 508 Tags causing an out of Memory exception


Xarnius

Recommended Posts

Hello,

I have been tasked with producing a Proof of Concept surrounding the ability to produce extremely large reports.  We have been using the Jasper engine within an in-house reporting system coupled with iReports, since version .0.6.4.  We have recently been asked by our clients to enhance the reporting engine to run reports that would easily exceed 1GB in size in PDF format.

I'm currently using version 3.7.0 of the Jasper engine and has the following code snippets generating the report.

 

I'm able to generate a report in PDF I have the compression tag set within the exportReportToPdfFile, and use the virtualizer.  However, when I add the following tags to turn on the 508 PDF tags, the swap file finishes successfully, but at 75-90 MB during the PDF generation I take an OutOfMemory exception.

 I have exhausted nearly every alternative I can think of, but know that the problem is somehow tied to the actual PDF generation piece, the fillReport is completing and greating a 3.7GB swap file.  The largest report I was able to run, without tags turned on was 1.15GB, took 9 hrs to run, with a total of 623,057 pages, but when I turned the tags on it didn't complete.

Is it trying to create the PDF file in memory only?  I have tried dropping Jasperreports' 4.1.2 iText library into the 3.7.0 Jasper engine, version 2.1.7, but the same error occurs.  This doesn't appear to be an issue related to the virtualizer, however, do the above parameters for the swapFile and invoking the virtualizer look practical?  Any assistance would greatly appreciated.             -Dan

Code:
JRSwapFile swapFile = new JRSwapFile(tempdir, 4096 , 4096);System.out.println("Initializing report virtualizer");virtualizer = new JRSwapFileVirtualizer(300, swapFile, true);parameters.put(JRParameter.REPORT_VIRTUALIZER, virtualizer);System.out.println("parameters: " + parameters);System.out.println("virtualizer parameter set - starting pdf creation");long start = System.currentTimeMillis();System.out.println("fillreport file name: " + qc.getAppProperty("ReportDir") + "/" + rpt);JasperPrint jasperPrint = JasperFillManager.fillReport(qc.getAppProperty("ReportDir") + "/"  + rpt, parameters, conn);System.out.println("fillreport time : " + (System.currentTimeMillis() - start)); start = System.currentTimeMillis();System.out.println("beginning PDF export");JasperExportManager.exportReportToPdfFile(jasperPrint, tempdir + "/" + qr.queID + "." + ext);System.out.println("PDF creation time : " + (System.currentTimeMillis() - start));/////////////////////////////		exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);		exporter.setParameter(JRPdfExporterParameter.IS_TAGGED, Boolean.TRUE);		exporter.setParameter(JRPdfExporterParameter.IS_COMPRESSED, Boolean.TRUE);			exporter.setParameter(JRPdfExporterParameter.FORCE_SVG_SHAPES, Boolean.TRUE);				exporter.setParameter(JRPdfExporterParameter.TAG_LANGUAGE, "English-US");		exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, destFileName);
Link to comment
Share on other sites

  • Replies 9
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Here is the stacktrace of the exception:

 

Code:
Oct 20, 2011 2:33:24 PM com.caucho.hessian.server.HessianSkeleton invokeWARNING: java.lang.OutOfMemoryError: Java heap spacejava.lang.OutOfMemoryError: Java heap space	at com.lowagie.text.pdf.BidiLine.<init>(Unknown Source)	at com.lowagie.text.pdf.ColumnText.addWaitingPhrase(Unknown Source)	at com.lowagie.text.pdf.ColumnText.go(Unknown Source)	at com.lowagie.text.pdf.ColumnText.go(Unknown Source)	at net.sf.jasperreports.engine.export.JRPdfExporter.exportText(JRPdfExporter.java:2108)	at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:735)	at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:695)	at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:584)	at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:380)	at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfFile(JasperExportManager.java:130)	at org.ifmc.report.engine.Jasper370Service.runReport(Jasper370Service.java:244)	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)	at java.lang.reflect.Method.invoke(Method.java:585)	at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:157)	at com.caucho.hessian.server.HessianServlet.service(HessianServlet.java:365)	at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)	at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124)	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3395)	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)	at weblogic.security.service.SecurityManager.runAs(Unknown Source)	at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2140)	at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2046)	at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1366)	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)	at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)Exception in thread "Timer-5" java.lang.OutOfMemoryError: Java heap space	at com.lowagie.text.pdf.BidiLine.<init>(Unknown Source)	at com.lowagie.text.pdf.ColumnText.addWaitingPhrase(Unknown Source)	at com.lowagie.text.pdf.ColumnText.go(Unknown Source)	at com.lowagie.text.pdf.ColumnText.go(Unknown Source)	at net.sf.jasperreports.engine.export.JRPdfExporter.exportText(JRPdfExporter.java:2108)	at net.sf.jasperreports.engine.export.JRPdfExporter.exportElements(JRPdfExporter.java:735)	at net.sf.jasperreports.engine.export.JRPdfExporter.exportPage(JRPdfExporter.java:695)	at net.sf.jasperreports.engine.export.JRPdfExporter.exportReportToStream(JRPdfExporter.java:584)	at net.sf.jasperreports.engine.export.JRPdfExporter.exportReport(JRPdfExporter.java:380)	at net.sf.jasperreports.engine.JasperExportManager.exportReportToPdfFile(JasperExportManager.java:130)	at org.ifmc.report.engine.Jasper370Service.runReport(Jasper370Service.java:244)	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)	at java.lang.reflect.Method.invoke(Method.java:585)	at com.caucho.hessian.server.HessianSkeleton.invoke(HessianSkeleton.java:157)	at com.caucho.hessian.server.HessianServlet.service(HessianServlet.java:365)	at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:226)	at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:124)	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)	at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)	at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3395)	at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)	at weblogic.security.service.SecurityManager.runAs(Unknown Source)	at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2140)	at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2046)	at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1366)	at weblogic.work.ExecuteThread.execute(ExecuteThread.java:200)	at weblogic.work.ExecuteThread.run(ExecuteThread.java:172)
Link to comment
Share on other sites

I am in the process of getting that information for you. However, I do find it interesting that it is only when the 508 tags are turned on that there is an issue. There must be some connection between the 508 tags and the call to the iText columnText.go method that is handled differently between these two scenarios (508 tags on/off).
Link to comment
Share on other sites

At first sight, this does look like an iText limitation.  Heap dumps show that com.lowagie.text.pdf.PdfStructureElement objects accumulate in memory, so it might be that such elements cannot be written to the PDF output in streaming fashion and iText needs to keep the whole structure in memory.

Still, we'd need to investigate deeper and see if there's a way to avoid that.  Maybe JR is not using the iText feature in the optimal way, and there's something we can do to prevent the objects from acumulating in memory.  Log a bug for this issue so that we don't forget about it.

Regards,

Lucian

Link to comment
Share on other sites

Nice detective work!  So you're using some sort of tool to analyze the memory issue?  Are you just using JProfiler or YourKit? 

http://stackoverflow.com/questions/1716597/java-memory-leak-detection-tools

I wish I had as large of a data set as you're using to duplicate this.  You might be some of the first people on the forum to be exporting as large of a data set to PDF as you're attempting.  The problem very well could be in iText.  I'm very interesting if you can find the source of the leak.  Hopefully one of those tools could point to a massive cluster of objects somewhere in memory.  If you can afford it, YourKit is the best and worth the cost in my humble opinion.

If you can pinpoint to where the leak is and write a Jasper tracking ticket for it, throw the tracker on this thread for others to see when they're having the same problems.  Even if the issue is within iText, I'd still write a Jasper ticket for it and put it here.  If you do find that the problem is iText, check their website and see if you have the latest version or not and check their trackers as well to see if others are having similiar issues?  Just some more suggestions.




Post Edited by frankhassanabad at 11/02/2011 18:44
Link to comment
Share on other sites

frankhassanabad
Wrote:
 

This might be a library limitation.  Thanks for the stack trace.  Are you running on a 32 bit or 64 bit JVM and what are *all* of your memory settings for that?



Post Edited by frankhassanabad at 11/02/2011 16:04
 
JVM 32 bit
The weblogic console shows: -Xms2048m -Xmx2048m -XX:MaxPermSize=256m
 
Link to comment
Share on other sites

Hi All,

Thanks for information provided by u in this thread.

 i am using swap virtualiger ,so that i can generate large report having images in jasper.but i am getting  out of Memory exception . like below.

[11/1/11 11:44:43:908 GMT] 0000002a JRFillSubrepo E   Fill 1826254042: exception <java.lang.OutOfMemoryError>java.lang.OutOfMemoryError
 at java.awt.image.DataBufferByte.<init>(DataBufferByte.java:89)
 at java.awt.image.ComponentSampleModel.createDataBuffer(ComponentSampleModel.java:432)
 at java.awt.image.Raster.createWritableRaster(Raster.java:979)
 at javax.imageio.ImageTypeSpecifier.createBufferedImage(ImageTypeSpecifier.java:1199)
 at javax.imageio.ImageReader.getDestination(ImageReader.java:2909)
 at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:926)
 at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:898)
 at javax.imageio.ImageIO.read(ImageIO.java:1430)
 at javax.imageio.ImageIO.read(ImageIO.java:1352)
 at net.sf.jasperreports.engine.util.JRJdk14ImageReader.readImage(JRJdk14ImageReader.java:54)
 at net.sf.jasperreports.engine.util.JRImageLoader.loadImage(JRImageLoader.java:245)
 at net.sf.jasperreports.engine.JRImageRenderer.getImage(JRImageRenderer.java:476)
 at net.sf.jasperreports.engine.JRImageRenderer.getDimension(JRImageRenderer.java:512)
 at net.sf.jasperreports.engine.fill.JRFillImage.fitImage(JRFillImage.java:1251)
 at net.sf.jasperreports.engine.fill.JRFillImage.prepare(JRFillImage.java:1173)
 at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:329)
 at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:419)
 at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:378)
 at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2028)
 at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:757)
 at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportContent(JRVerticalFiller.java:289)
 at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:131)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:942)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:860)
 at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:612)
 at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59)
 at net.sf.jasperreports.engine.fill.JRThreadSubreportRunner.run(JRThreadSubreportRunner.java:205)
 at java.lang.Thread.run(Thread.java:797)

[11/1/11 11:44:43:939 GMT] 0000002a RequestProces W   Unhandled Exception thrown: class net.sf.jasperreports.engine.JRRuntimeException
[11/1/11 11:44:43:939 GMT] 0000002a TilesRequestP E   javax.servlet.ServletException: java.lang.OutOfMemoryError
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R net.sf.jasperreports.engine.JRRuntimeException: java.lang.OutOfMemoryError
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:710)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:329)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRFillFrame.prepare(JRFillFrame.java:215)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:329)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:419)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:378)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2060)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:757)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:269)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:127)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:942)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:860)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:84)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:624)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.jlr.dart.reports.actions.GenerateDraftTestReportAction.produceReport(GenerateDraftTestReportAction.java:159)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ford.jlr.jasper.AbstractJasperReportAction.execute(AbstractJasperReportAction.java:53)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at javax.servlet.http.HttpServlet.service(HttpServlet.java:743)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:966)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:907)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ford.jlr.tag.crumb.CrumbFilter.doFilter(CrumbFilter.java:65)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ford.jlr.tag.table.ExportFilter.doFilter(ExportFilter.java:63)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ford.jlr.tag.table.CustomizeViewFilter.doFilter(CustomizeViewFilter.java:73)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:701)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:646)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:475)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:463)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:92)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
[11/1/11 11:44:43:923 GMT] 0000002a SystemErr     R  at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1812)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R Caused by: java.lang.OutOfMemoryError
 at java.awt.image.DataBufferByte.<init>(DataBufferByte.java:89)
 at java.awt.image.ComponentSampleModel.createDataBuffer(ComponentSampleModel.java:432)
 at java.awt.image.Raster.createWritableRaster(Raster.java:979)
 at javax.imageio.ImageTypeSpecifier.createBufferedImage(ImageTypeSpecifier.java:1199)
 at javax.imageio.ImageReader.getDestination(ImageReader.java:2909)
 at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:926)
 at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:898)
 at javax.imageio.ImageIO.read(ImageIO.java:1430)
 at javax.imageio.ImageIO.read(ImageIO.java:1352)
 at net.sf.jasperreports.engine.util.JRJdk14ImageReader.readImage(JRJdk14ImageReader.java:54)
 at net.sf.jasperreports.engine.util.JRImageLoader.loadImage(JRImageLoader.java:245)
 at net.sf.jasperreports.engine.JRImageRenderer.getImage(JRImageRenderer.java:476)
 at net.sf.jasperreports.engine.JRImageRenderer.getDimension(JRImageRenderer.java:512)
 at net.sf.jasperreports.engine.fill.JRFillImage.fitImage(JRFillImage.java:1251)
 at net.sf.jasperreports.engine.fill.JRFillImage.prepare(JRFillImage.java:1173)
 at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:329)
 at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:419)
 at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:378)
 at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2028)
 at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:757)
 at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportContent(JRVerticalFiller.java:289)
 at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:131)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:942)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:860)
 at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:612)
 at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59)
 at net.sf.jasperreports.engine.fill.JRThreadSubreportRunner.run(JRThreadSubreportRunner.java:205)
 at java.lang.Thread.run(Thread.java:797)

[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at java.awt.image.DataBufferByte.<init>(DataBufferByte.java:89)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at java.awt.image.ComponentSampleModel.createDataBuffer(ComponentSampleModel.java:432)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at java.awt.image.Raster.createWritableRaster(Raster.java:979)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at javax.imageio.ImageTypeSpecifier.createBufferedImage(ImageTypeSpecifier.java:1199)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at javax.imageio.ImageReader.getDestination(ImageReader.java:2909)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:926)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:898)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at javax.imageio.ImageIO.read(ImageIO.java:1430)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at javax.imageio.ImageIO.read(ImageIO.java:1352)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.util.JRJdk14ImageReader.readImage(JRJdk14ImageReader.java:54)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.util.JRImageLoader.loadImage(JRImageLoader.java:245)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.JRImageRenderer.getImage(JRImageRenderer.java:476)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.JRImageRenderer.getDimension(JRImageRenderer.java:512)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRFillImage.fitImage(JRFillImage.java:1251)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRFillImage.prepare(JRFillImage.java:1173)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:329)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:419)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:378)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2028)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:757)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportContent(JRVerticalFiller.java:289)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:131)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:942)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:860)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:612)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at net.sf.jasperreports.engine.fill.JRThreadSubreportRunner.run(JRThreadSubreportRunner.java:205)
[11/1/11 11:44:43:939 GMT] 0000002a SystemErr     R  at java.lang.Thread.run(Thread.java:797)
[11/1/11 11:45:36:439 GMT] 0000002d JRFillSubrepo E   Fill 6160478: exception <java.lang.OutOfMemoryError>java.lang.OutOfMemoryError
 at java.awt.image.DataBufferByte.<init>(DataBufferByte.java:89)
 at java.awt.image.ComponentSampleModel.createDataBuffer(ComponentSampleModel.java:432)
 at java.awt.image.Raster.createWritableRaster(Raster.java:979)
 at com.sun.imageio.plugins.bmp.BMPImageReader.read(BMPImageReader.java:733)
 at javax.imageio.ImageIO.read(ImageIO.java:1430)
 at javax.imageio.ImageIO.read(ImageIO.java:1352)
 at net.sf.jasperreports.engine.util.JRJdk14ImageReader.readImage(JRJdk14ImageReader.java:54)
 at net.sf.jasperreports.engine.util.JRImageLoader.loadImage(JRImageLoader.java:245)
 at net.sf.jasperreports.engine.JRImageRenderer.getImage(JRImageRenderer.java:476)
 at net.sf.jasperreports.engine.JRImageRenderer.getDimension(JRImageRenderer.java:512)
 at net.sf.jasperreports.engine.fill.JRFillImage.fitImage(JRFillImage.java:1251)
 at net.sf.jasperreports.engine.fill.JRFillImage.prepare(JRFillImage.java:1173)
 at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:329)
 at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:419)
 at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:378)
 at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:2028)
 at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:757)
 at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportContent(JRVerticalFiller.java:289)
 at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:131)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:942)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:860)
 at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:612)
 at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59)
 at net.sf.jasperreports.engine.fill.JRThreadSubreportRunner.run(JRThreadSubreportRunner.java:205)
 at java.lang.Thread.run(Thread.java:797)

[11/1/11 11:45:36:470 GMT] 0000002d RequestProces W   Unhandled Exception thrown: class net.sf.jasperreports.engine.JRRuntimeException
[11/1/11 11:45:36:486 GMT] 0000002d TilesRequestP E   javax.servlet.ServletException: java.lang.OutOfMemoryErroR

Code for virtualization i have used in my mthod is

 

protected JasperPrint produceReport(HttpServletRequest request,
   HttpServletResponse response) throws Exception{

  String testReportId = request.getParameter("ReportId");
  JRDataSource dataSource=null;
  //JasperPrint jasperPrint = null;
  ReportDto dto = ServiceFactory.getInstance().getReportService().getReport(ReportId);
  UserDto user = (UserDto)request.getSession().getAttribute("user");
  CanViewTestReportDetailsRule rule = new CanViewTestReportDetailsRule( user, dto);
       
  
  
   JasperReport  summaryReport = getCompiledReport("summaryReport");
   JasperReport  summaryReport = getCompiledReport("aaaa");
   /*Some other report compiled here */
   
      HashMap parameters = new HashMap();
      if (VITUALIZER_SWAP_FILE.equals("swap")){
    // creating the virtualizer
    JRSwapFile swapFile = new JRSwapFile(cacheDir, 2048, 1024);
    //JRSwapFile swapFile = new JRSwapFile( getServletContext().getRealPath("/reports/operationalreports/"), 1024, 1024);    
    JRSwapFileVirtualizer virtualizer = new JRSwapFileVirtualizer(3, swapFile, true);
    parameters.put(JRParameter.REPORT_VIRTUALIZER, virtualizer); 
   }

      parameters.put("summaryReport", summaryReport);    
      parameters.put("summaryReport", summaryReport);
     
      /*Some other report added here */
     
  
      dataSource=getData(dto, test);
     // JasperPrint  jasperPrint=new JasperPrint();
    JasperPrint  jasperPrint = JasperFillManager.fillReport(testReport,parameters,getData(dto, test));
    //  jasperPrint = fillReport(testReport,parameters,dataSource);     
/*
   long start = System.currentTimeMillis();
   JasperPrint jasperPrint = JasperFillManager.fillReport(testReport, parameters, dataSource);
   System.err.println("Filling time : " + (System.currentTimeMillis() - start));
   */
      return jasperPrint; 
  }
  return null;
 }

I can see a swap file created in my temp folder.and it is filling on the basis of parameter in swap file.

however i am getting error .

Please advice.it will be great help.

 

 

 

Link to comment
Share on other sites

Hi sumadha,

 

It appears you are running into a similar issue, but different enough to merit its own thread. Also when "dumping" large amounts of code it is cleaner to use the code box. Would you be ok with moving your topic to its own thread dealing with AWT images, and remove your post from this thread?

 

Thanks in advance.

 

I saw you asked how to create a new topic in a previous thread. From the Main topics page, you may click new topic to do this.

 

Link to comment
Share on other sites

Thanks for the answer to how much memory you're using with your Java JVM.  I am guessing you're using Sun's JVM and not BEA's JRocket?  Is that true?  With Sun's 32 bit JVM you are limited to around 2 gigs of memory where I have "heard" that with BEA's JVM you're not limited to that 2 gigs.  You can actually bump it up to a maximum of around 4.  Be cautious about doing that if you're also running a 32 bit Operating System and have at maximum  4 gigs for your system as the OS needs some of that memory.  So this brings me to my next volley of questions.

What OS and bit level is it?  Hopefully it's 64 bits.  With 32 bit OS'es you have can 2-4 gig limitations on file sizes as well as maximum memory sizes of 2-4 gigs.  Sometimes you have to install large file system support or high mem support depending on if you're using Windows, Linux, etc... to get around these limitations.  Windows and Linux also reserve a set amount of memory for their operating system and you can run into problems if you start trying to allocate memory with a JVM which interfers with that.  This is all basic googling info I'm throwing out.  You can find ways to shrink the OS level and you can also find ways to "rebase" Sun's .dll's so that you can actually allocate up to 3 gigs on Sun's JVM.  It's tricky, a last resot, and I've only done these things as a last resort.

Now, I would have hoped you could say you're running a 64 bit JVM on a 64 bit Operating System with 5+ gigs of memory.  Then I could just say for you to bump up your heap size on your JVM and you'd be good.  That is the best way forward next to actually fixing iText -- the best solution obviously. 

 

I'm following you on the iText message boards BTW.  This is you there isn't it ;-)

http://itext-general.2136553.n4.nabble.com/OutofMemory-error-being-throw-in-iText-using-JasperReports-3-7-0-4-1-2-or-4-1-3-td3984507.html

 

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