Large report generation with Jasper using Virtuali

2019-07-24 22:02发布

问题:

We are using Japser to generate reports in our application

We have upgraded from 5.0.1 to 6.4 to achive better performance but this is what we are not seeing good results after few test runs. It takes approximately 44 mins to generate the report

This is our configuration

Jasper version : 6.4

JDK 1.7

Server : tomcat 7 , 3GB RAM

Number of records : 850k

We get the results from database and hand it over to jasper.

Below is the memory consumption and CPU utilization when generating the report

JRSwapFile swapFile = new JRSwapFile(System.getProperty("java.io.tmpdir"), 4096, 25);
JRAbstractLRUVirtualizer virtualizer = new JRSwapFileVirtualizer(2, swapFile, true);
virtualizer.setReadOnly(false);
context.getReportParams().put(JRParameter.REPORT_VIRTUALIZER, virtualizer);

Looking for suggestions on how to reduce report generation time with lower memory consumption. is that how the reports are supposed to perform for this large dataset or we are doing something wrong here ?

We are using JRSwapFileVirtualizer. When virtualizer was not used, then time taken to generate report was better but we could not generate large reports. Should we use another virtualizer like Gzip virtualizer or tweak parameters for File Virtualizer like maxSize, blockSize and minGrowCount parameters.

Update : Tried with GzipVirtualizer but not much difference in timings or memory consumption