ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

Performance of Jaspersoft report using High Charts

book

Article ID: 142616

calendar_today

Updated On:

Products

Clarity PPM On Premise

Issue/Introduction

The report at times becomes very slow and if the report contains a large amount of data it can lead to out of memory errors in Jaspersoft logs

STEPS TO REPRODUCE

  1. Create a custom report which contains high chart widgets
  2. Run the report with a large data set 

Expected Results: The report should be able to run quickly and provide output 

Actual Results: The report at times becomes very slow and if the report contains a large amount of data it can lead to out of memory errors in Jaspersoft logs

Sample error when a large report with High Chart Widget is scheduled:

2019-10-10 05:22:10,792 ERROR JobRunShell,quartzScheduler_Worker-1:222 [] - Job ReportJobs.job_11698804 threw an unhandled Exception:
java.lang.OutOfMemoryError: Java heap space
2019-10-10 05:25:14,152 ERROR ErrorLogger,quartzScheduler_Worker-1:2361 [] - Job (ReportJobs.job_11698804 threw an exception.
org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception: java.lang.OutOfMemoryError: Java heap space]
at org.quartz.core.JobRunShell.run(JobRunShell.java:224)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:557)
Caused by: java.lang.OutOfMemoryError: Java heap space
2019-10-10 06:00:59,875 ERROR JRFillSubreport,quartzScheduler_Worker-2:879 [] - Fill 1: exception
java.lang.OutOfMemoryError: Java heap space

Cause

This is due to the fact that high High charts are performance oriented and its recommended to use the HTML5 Charts. Also in Jaspersoft High charts are default rendered using the Rhino Engine and memory management of Rhino engine is not the best. 

Environment

Release : 15.x

Resolution

  1. Stop all the Jaspersoft Services
  2. Backup the  jasperreports.properties file and it can be found under JASPERSOFT_HOME/webapps/reportservice/WEB-INF/classes
  3. Add the line to the end of file
    1. Assuming Jaspersoft is installed in non windows and under path '/opt/tomcat/apache-tomcat-8.5.30/webapps/reportservice' then add the line com.jaspersoft.jasperreports.highcharts.phantomjs.executable.path=/opt/tomcat/apache-tomcat-8.5.30/webapps/reportservice/phantomjs
    2. Assuming Jaspersoft is installed in windows and under path 'C:\App\Jasper\webapps\reportservice' then add the com.jaspersoft.jasperreports.highcharts.phantomjs.executable.path=C:\\App\\Jasper\\webapps\\reportservice\\phantomjs\\windows\\phantomjs.exe

Sample change from Windows:

#Functions can be used to format html5 datalabels and tooltips
com.jaspersoft.jasperreports.highcharts.function.properties.allowed=true
com.jaspersoft.jasperreports.fusion.phantomjs.executable.path=C:\\App\\Jasper\\webapps\\reportservice\\phantomjs\\windows\\phantomjs.exe
com.jaspersoft.jasperreports.fusion.phantomjs.executable.timeout=600000
com.jaspersoft.jasperreports.highcharts.phantomjs.executable.path=C:\\App\\Jasper\\webapps\\reportservice\\phantomjs\\windows\\phantomjs.exe

Additional Information

Note: This has been added as part of DE51537 in Jaspersoft 7.1.3_6.3.0.10 and higher