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

Out of Memory Issue JRSwapFileVirtualizer


manish.gupta

Recommended Posts

I am facing Out of Memory issue while creating Jasper Report Pdf/Xls of about 85000-90000 records

I am fetching the data from database using Stored procedure and using JRSwapFileVirtualizer.

Stack trace for Pdf creation:

2014-11-19 17:57:31,750 INFO  [ReportManager] Report query execution and filling process begin.

2014-11-19 18:09:11,012 INFO  [ReportManager] Report query execution and filling process completed.

2014-11-19 18:09:11,013 INFO  [ReportManager] PDF export started.

2014-11-19 18:15:42,552 INFO  [ReportManager] Swap file disposed.

2014-11-19 18:15:42,553 INFO  [ReportManager] Virtualizer cleanup.

2014-11-19 18:15:42,562 ERROR [ReportAccessLocal] Unexpected Error

java.lang.OutOfMemoryError: Java heap space

       at java.util.Arrays.copyOf(Arrays.java:2786)

       at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)

       at java.io.BufferedOutputStream.write(BufferedOutputStream.java:105)

       at com.lowagie.text.pdf.OutputStreamCounter.write(Unknown Source)

       at java.io.ByteArrayOutputStream.writeTo(ByteArrayOutputStream.java:109)

       at com.lowagie.text.pdf.PdfStream.toPdf(Unknown Source)

       at com.lowagie.text.pdf.PdfIndirectObject.writeTo(Unknown Source)

       at com.lowagie.text.pdf.PdfWriter$PdfBody.add(Unknown Source)

 

Stack trace for Xls creation:

2014-11-20 11:01:12,250 INFO  [ReportManager] (http-localhost%2F127.0.0.1-8080-1) Report query execution and filling process completed.

2014-11-20 11:01:12,251 INFO  [ReportManager] (http-localhost%2F127.0.0.1-8080-1) Excel export started.

2014-11-20 11:01:12,254 INFO  [sTDOUT] (http-localhost%2F127.0.0.1-8080-1) ReportEngine: Started Generate XLS Popup Report Function!

2014-11-20 11:03:09,787 WARN  [org.jboss.system.server.profileservice.hotdeploy.HDScanner] (HDScanner) Scan failed

java.lang.OutOfMemoryError: GC overhead limit exceeded

at java.lang.StringCoding$StringEncoder.encode(StringCoding.java:232)

at java.lang.StringCoding.encode(StringCoding.java:272)

at java.lang.String.getBytes(String.java:946)

at java.io.UnixFileSystem.getLastModifiedTime(Native Method)

at java.io.File.lastModified(File.java:826)

 

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

You're running several jobs at once - one to export to pdf and another to excel. JasperReports Server is memory intensive. I think JRSwapFileVirtualizer is only for generating reports and not much for when exporting large reports. Recommend increasing memory and running export in async.

Link to comment
Share on other sites

Your memory size is just too small. Jaspersoft recommends at least 4GB. Also, recommend to write your own servlet to generate pdf and xlsx files.

 

>I thought JaperVirtualizer itself ensures that Jvm never runs out of memory. Keep on moving the data to the swap file. Please suggest.

 

As you've found out as I've also found out, this just isn't. I've found that extensive memory swapping uses much CPU and the server just comes to a still and freezes and have to be rebooted to forcefully stop all the processes.

JasperReports library and a nice set of classes and methods and it's not too difficult to write a simple servlet to generate pdf and xlsx files.

 

This won't pertain to you but for all others, if you're running large reports, do it in a background async with only 1 concurrent job.

Link to comment
Share on other sites

  • 1 month later...

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