Jump to content

high memory consumption to virtualization routine


cris_rufino

Recommended Posts

Hi,

I using jasper 3.0.0 with virtualization, that generate files on disk avoiding outofmemory. Great!!

But for too big reports (about 100.000 pages), the memory grow up and tomcat go down.

Using JRSwapFileVirtualizer:

- Analisyng the memory usage with VisualVM, the JRSwapFileVirtualizer routine still have high memory consumption to manage the files genereted on disk.

- I did try setting the virtualize parameters (blockSize, minGrowSize and maxSize). They help, but don't solve the problem completely.

Using JRFileVirtualizer:

- The problem continue, several files on disk and high memory consumption for virtualization routine.

Then I would like a solution that, for big reports, the virtualization routine don't have high memory consumption. The time to generate the report can be grow up in this case, but the tomcat can't go down. I think jasper should have this solution.

Thanks for any response.

[]'s

Cris.

Link to comment
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Follow the code below, with virtualization parameters...

OK, the virtualization will consume some memory. But this is causing memory problems in my app.

Is the only solution limit the size of reports?

Code:
int blockSize=10, minGrowSize=5, maxSize=10;JRSwapFile swapFile = new JRSwapFile("/home/report/swap",blockSize,minGrowSize);JRAbstractLRUVirtualizer virtualizer = new JRSwapFileVirtualizer(maxSize,swapFile, swapOwner);params.put(JRParameter.REPORT_VIRTUALIZER, virtualizer);JasperPrint jasperPrint = JasperFillManager.fillReport(jasperFile, params, datasource);virtualizer.setReadOnly(true);JasperExportManager.exportReportToPdfFile(jasperPrint, "/home/report/file.pdf");
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...