sayantanr Posted August 20, 2015 Share Posted August 20, 2015 Please, consider the following code snippet -JRBeanCollectionDataSource beanColDataSource = new JRBeanCollectionDataSource(jasperReportBeanList);String printFileName = JasperFillManager.fillReportToFile(templateFilePath, parameters, beanColDataSource);[/code]Here , jasperReportBeanList containing over 250000 records. Now, at the time of executing JasperFillManager.fillReportToFile(templateFilePath, parameters, beanColDataSource) method I am getting GC over exceeded error or out of memory error.Please, note that I have also added the following line in my code -DefaultJasperReportsContext context = DefaultJasperReportsContext.getInstance();JRPropertiesUtil.getInstance(context).setProperty("net.sf.jasperreports.xpath.executer.factory", "net.sf.jasperreports.engine.util.xml.JaxenXPathExecuterFactory");[/code]But, still I am getting error. Any help is appreciated. Link to comment Share on other sites More sharing options...
abc.hegde Posted August 20, 2015 Share Posted August 20, 2015 Can you post the exact stack trace? Link to comment Share on other sites More sharing options...
hozawa Posted August 20, 2015 Share Posted August 20, 2015 So, how much memory is being used? If it's out of memory, try increasing it. Link to comment Share on other sites More sharing options...
sayantanr Posted August 21, 2015 Author Share Posted August 21, 2015 The stack trace is given below -08:33:32.671 [pool-2-thread-1] ERROR c.n.f.inf.console.ConsoleJobExecutor - Java heap spacejava.lang.OutOfMemoryError: Java heap space at java.util.zip.InflaterInputStream.<init>(InflaterInputStream.java:88) ~[na:1.7.0_07] at java.util.zip.ZipFile$ZipFileInflaterInputStream.<init>(ZipFile.java:387) ~[na:1.7.0_07] at java.util.zip.ZipFile.getInputStream(ZipFile.java:368) ~[na:1.7.0_07] at java.util.jar.JarFile.getManifestFromReference(JarFile.java:184) ~[na:1.7.0_07] at java.util.jar.JarFile.getManifest(JarFile.java:165) ~[na:1.7.0_07] at sun.misc.URLClassPath$JarLoader$2.getManifest(URLClassPath.java:756) ~[na:1.7.0_07] at java.net.URLClassLoader.defineClass(URLClassLoader.java:416) ~[na:1.7.0_07] at java.net.URLClassLoader.access$100(URLClassLoader.java:71) ~[na:1.7.0_07] at java.net.URLClassLoader$1.run(URLClassLoader.java:361) ~[na:1.7.0_07] at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_07] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_07] at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0_07] at java.lang.ClassLoader.loadClass(ClassLoader.java:423) ~[na:1.7.0_07] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) ~[na:1.7.0_07] at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ~[na:1.7.0_07] at net.sf.jasperreports.engine.fill.JRFillContext.dispose(JRFillContext.java:560) ~[jasperreports-5.6.0.jar:5.6.0] at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:1008) ~[jasperreports-5.6.0.jar:5.6.0] at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:892) ~[jasperreports-5.6.0.jar:5.6.0] at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:114) ~[jasperreports-5.6.0.jar:5.6.0] at net.sf.jasperreports.engine.JasperFillManager.fillToFile(JasperFillManager.java:505) ~[jasperreports-5.6.0.jar:5.6.0] at net.sf.jasperreports.engine.JasperFillManager.fillReportToFile(JasperFillManager.java:889) ~[jasperreports-5.6.0.jar:5.6.0] at com.nri.durga.maf.batch.comparisontool2.ComparisonReportGenerator.createReport(ComparisonReportGenerator.java:1179) ~[durga-maf-SNAPSHOT.jar:na] at com.nri.durga.maf.batch.comparisontool2.ComparisonReportGenerator.createReportFile(ComparisonReportGenerator.java:1134) ~[durga-maf-SNAPSHOT.jar:na] at com.nri.durga.maf.batch.comparisontool2.ComparisonEngine.checkOutput(ComparisonEngine.java:174) ~[durga-maf-SNAPSHOT.jar:na] at com.nri.durga.maf.batch.comparisontool2.ComparisonTool.execute(ComparisonTool.java:64) ~[durga-maf-SNAPSHOT.jar:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_07] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_07] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_07] at java.lang.reflect.Method.invoke(Method.java:601) ~[na:1.7.0_07] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) ~[spring-aop-3.2.2.RELEASE.jar:3.2.2.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) ~[spring-aop-3.2.2.RELEASE.jar:3.2.2.RELEASE] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) ~[spring-aop-3.2.2.RELEASE.jar:3.2.2.RELEASE]16:40:10.257 [main] INFO c.n.f.inf.console.ConsoleJobExecutor - Using default configuration path16:40:31.286 [main] INFO c.nrift.finch.inf.startup.Operation - Loading preferenceKeys...16:40:31.317 [main] INFO c.nrift.finch.inf.startup.Operation - Loading preference... Link to comment Share on other sites More sharing options...
sayantanr Posted August 21, 2015 Author Share Posted August 21, 2015 4GB memory is being used for application. We can not increase more than that. Link to comment Share on other sites More sharing options...
abc.hegde Posted August 21, 2015 Share Posted August 21, 2015 Try using file virtualizer technique so that the generation will not cause out of memory. There might be slight increase in the generation time but you can avoid out of memory issues. Link to comment Share on other sites More sharing options...
marianol Posted August 21, 2015 Share Posted August 21, 2015 I agree with @abc.hegde a File Report Virtualizer may be your choice.See:- http://community.jaspersoft.com/wiki/comparison-report-virtualizers- http://jasperreports.sourceforge.net/sample.reference/virtualizer/ Link to comment Share on other sites More sharing options...
sayantanr Posted August 22, 2015 Author Share Posted August 22, 2015 Thanks for suggestion. I have tried with virtualizer. But, still I am facing this problem. 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