dkommineni Posted April 6, 2010 Share Posted April 6, 2010 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 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