cris_rufino Posted January 11, 2010 Share Posted January 11, 2010 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.[]'sCris. Link to comment Share on other sites More sharing options...
lucianc Posted January 13, 2010 Share Posted January 13, 2010 What parameters did you use for the swap file virualizer?Virtualizers do not guarantee that you can generate arbitrarily large reports. They still consume some memory, so you will be able much bigger reports than without using a virtualizer.Regards,Lucian Link to comment Share on other sites More sharing options...
cris_rufino Posted January 13, 2010 Author Share Posted January 13, 2010 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 More sharing options...
lucianc Posted January 13, 2010 Share Posted January 13, 2010 blockSize is much too small. In usual cases it should be something in the range of kilos, so try 4096 for instance.Regards,Lucian Post Edited by lucianc at 01/13/2010 16:01 Link to comment Share on other sites More sharing options...
cris_rufino Posted January 14, 2010 Author Share Posted January 14, 2010 Hi Lucian,I have tried with blockSize 1024, 2048 and 4096.With these values I have better performace, this meaning that I coult make a larger report than before. But I still with my original problem.I will continue to find a solution.[]'s Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now