Jump to content
Changes to the Jaspersoft community edition download ×

Handling huge Jasper Reports - Out of memory


dkommineni

Recommended Posts

Hi, When i am running my Jasper Reports, I am getting the Java Heap Space Out of Memory erros. Please see the code below which i am using. I am actually passing many parameters to the Jasper Reports. One among them is String. Some times this String value contains 50 MB data. When i am passing 50 MB data, system is not able to process the report. before adding 50 MB data, system is querying lot of information from DB and adding the String file content at the end. Please suggest me how to proceed further.

 

The exception is occurred during fill operation.

 

I even tried with File Virtualizer and Swap Virtualizer.

 

Any idea?

Code:
private File generateReport(File pDownloadDir, String psTemplate,			DownloadPatchSetVO pVO, Map pArgs) throws Exception {	File ret = null;	Connection conn = null;	try {		conn = ConnectionManager.getDBConnection().connect();		JRAbstractLRUVirtualizer virtualizer = null;		virtualizer = new JRGzipVirtualizer(2);		pArgs.put(JRParameter.REPORT_VIRTUALIZER, virtualizer);		JasperPrint repPrint = JasperFillManager.fillReport				(psTemplate,pArgs, conn);		String sDocfile = pDownloadDir.getAbsolutePath() + "/"				+ pVO.getFilename();				if (virtualizer != null)		{			virtualizer.setReadOnly(true);					}								 		JasperExportManager.exportReportToPdfFile(repPrint, sDocfile);					ret = new File(sDocfile);	} finally {		try {			if (conn != null) {				conn.close();			}		} catch (Exception e) {		}	}	return ret;	} // generateReport
Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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