Implementation of JRDataSource to support huge data report generation using virtualization

0

Hi,

I have 10million records in my db table and want to generate a pdf report by fetching that data,As of now I am just passing the mysql connection to JasperFillManager.fillReport,and in report side I have created a data set and given the query definitation as

SELECT receivedJob_id AS ID ,received_date AS DATE,job_title AS Title,location AS Location,firstname AS FirstName,lastname AS LastName FROM receivedJobs

But when I tried to generate the report it gives me the exception saying,

Generating report with swap virtulizer..Filling report .......Nov 17, 2016 11:06:33 PM
 net.sf.jasperreports.engine.fill.JRFillSubreport prepareSEVERE: Fill 1: 
                                            exceptionjava.lang.OutOfMemoryError: GC overhead limit exceeded
 at com.mysql.jdbc.MysqlIO.nextRowFast(MysqlIO.java:2222)
 at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1999)
 at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:3504)
 at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:490)
 at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3198)
 at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2366)
 at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2789)
 at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2815)
 at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
 at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2322)
 at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:233)
 at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1114)
 at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:691)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1314)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:931)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:873)
 at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:665)
 at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59)
 at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:203)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)
Exception in thread "main" net.sf.jasperreports.engine.JRRuntimeException: 
                                                        java.lang.OutOfMemoryError: GC overhead limit exceeded
 at net.sf.jasperreports.engine.fill.JRFillSubreport.prepare(JRFillSubreport.java:809)
 at net.sf.jasperreports.components.table.fill.FillTableSubreport.prepareSubreport(FillTableSubreport.java:156)
 at net.sf.jasperreports.components.table.fill.FillTable.prepare(FillTable.java:399)
 at net.sf.jasperreports.engine.fill.JRFillComponentElement.prepare(JRFillComponentElement.java:151)
 at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:331)
 at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:384)
 at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:358)
 at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummaryNoLastFooterNewPage(JRVerticalFiller.java:1217)
 at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillSummary(JRVerticalFiller.java:1069)
 at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportEnd(JRVerticalFiller.java:329)
 at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:159)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:963)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:873)
 at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:87)
 at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:457)
 at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:864)
 at test.TestJasper.generateLargeReportWithSwapVirt(TestJasper.java:141)
 at test.TestJasper.main(TestJasper.java:53)Caused by: java.lang.OutOfMemoryError: GC overhead limit exceeded
 at com.mysql.jdbc.MysqlIO.nextRowFast(MysqlIO.java:2222)
 at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1999)
 at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:3504)
 at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:490)
 at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3198)
 at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2366)
 at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2789)
 at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2815)
 at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2155)
 at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2322)
 at net.sf.jasperreports.engine.query.JRJdbcQueryExecuter.createDatasource(JRJdbcQueryExecuter.java:233)
 at net.sf.jasperreports.engine.fill.JRFillDataset.createQueryDatasource(JRFillDataset.java:1114)
 at net.sf.jasperreports.engine.fill.JRFillDataset.initDatasource(JRFillDataset.java:691)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.setParameters(JRBaseFiller.java:1314)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:931)
 at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:873)
 at net.sf.jasperreports.engine.fill.JRFillSubreport.fillSubreport(JRFillSubreport.java:665)
 at net.sf.jasperreports.engine.fill.JRSubreportRunnable.run(JRSubreportRunnable.java:59)
 at net.sf.jasperreports.engine.fill.AbstractThreadSubreportRunner.run(AbstractThreadSubreportRunner.java:203)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)

I am not sure how it can be handled in jasper.Also Is there any one who has successfully generated the report with more than 10 million records with or without sub reports, If yes please share your approch how you are doing,I have done what ever I could ,but still it is giving the out of memory error when the data is in millions even if i use virtualzation.

Any lead would be great.

Thanks

RV

rv7up's picture
7
Joined: Jan 23 2016 - 9:38am
Last seen: 1 year 10 months ago

0 Answers:

No answers yet
Feedback