avinash.rajguru Posted August 8, 2017 Share Posted August 8, 2017 Hi all, I have scheduled over 150 report in jasper server and reports fetching data from mongodb. Scheduler runs every day and required to run within 2 hours,i am collecting over 40 millions records every day in mongodb and report fetching data from mongodb. I am getting Heap space memory error at the time of scheduler runs Error Message: The job was not completed. A system error occurred while running it. Exceptions: java.lang.OutOfMemoryError: Java heap space For this issue i have set following parameter in apache tomcat setenv.sh JAVA_OPTS="-Xms25g -Xmx35g -XX:PermSize=10g -XX:MaxPermSize=20g -Xss2m -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled $JAVA_OPTS " For some report scheduler runs but report not generated Link to comment Share on other sites More sharing options...
hozawa Posted August 8, 2017 Share Posted August 8, 2017 Try to find out the actually amount of memory each report required by each report. If you are scheduling jobs in parallel, you'll need to add memories for those jobs to get the total amount of memory your jasperreports server require. Link to comment Share on other sites More sharing options...
avinash.rajguru Posted August 9, 2017 Author Share Posted August 9, 2017 Thanks for replay ,I have tried some memory analysis when my scheduler runs the memory usages is 3-4 GB out off 40 GB .How to increase utilization and performace of jasper server ?Is there any log for job scheduler to check more information about job runs. Link to comment Share on other sites More sharing options...
deepakgup Posted August 9, 2017 Share Posted August 9, 2017 @Hozawa - What is the method to find the memory required per report. How do we find out - are there any commands or logs to figure this out?Also, this problem does not manifest itself everytime we run reports. This only happens after a few days of execution ... what is the methodolgy to investigate such an issue? Link to comment Share on other sites More sharing options...
deepakgup Posted August 9, 2017 Share Posted August 9, 2017 Hi AvinashCan you post your analysis here?Regards Link to comment Share on other sites More sharing options...
hozawa Posted August 9, 2017 Share Posted August 9, 2017 From the Tomcat Manager, check if Tomcat is really allocated the memory you've set.If you're getting out of memory after few days, there may be a memory leak. It may be better to restart tomcat every night before the scheduled reports are executed. Link to comment Share on other sites More sharing options...
ashwinlunkad Posted March 5, 2019 Share Posted March 5, 2019 Hello. I am having similar issue with Jasper Report Server - java.lang.OutOfMemoryError: Java heap space, on upgrading to Jasper Report 6.5.1.This is making the application completely unresponsive.The issue occurs at multiple locations and logs provided below. I have set the JVM Heap space to 8GB, but still does not help. Please let me know if you have any solutions. Thanks in advance.java.lang.OutOfMemoryError: Java heap spaceat java.util.Arrays.copyOf(Arrays.java:2786)at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:263)at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106)at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:116)at java.io.OutputStreamWriter.write(OutputStreamWriter.java:203)at java.io.Writer.write(Writer.java:140)at net.sf.jasperreports.engine.export.JRHtmlExporter.exportText(JRHtmlExporter.java:1224)at net.sf.jasperreports.engine.export.JRHtmlExporter.exportGrid(JRHtmlExporter.java:815)at net.sf.jasperreports.engine.export.JRHtmlExporter.exportPage(JRHtmlExporter.java:730)at net.sf.jasperreports.engine.export.JRHtmlExporter.exportReportToWriter(JRHtmlExporter.java:679)at net.sf.jasperreports.engine.export.JRHtmlExporter.exportReport(JRHtmlExporter.java:389)JBWEB000236: Servlet.service() for servlet STVPdfServlet threw exception: java.lang.OutOfMemoryError at java.io.ByteArrayOutputStream.hugeCapacity(ByteArrayOutputStream.java:123) [rt.jar:1.7.0_201] at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:117) [rt.jar:1.7.0_201] at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93) [rt.jar:1.7.0_201] at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:153) [rt.jar:1.7.0_201] at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82) [rt.jar:1.7.0_201] 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