Troubleshooting Jaspersoft High CPU with thread dumps

book

Article ID: 182952

calendar_today

Updated On:

Products

Clarity PPM SaaS Clarity PPM On Premise

Issue/Introduction

We have an high CPU issue on few nodes with Jaspersoft, how do we proceed to get the evidence for thread dumps? 

Cause

Reasons for CPU issues are:

a) poorly designed reports which cause a buggy infinite loop
b) lack of space in the temp directory that Tomcat is using
c) something unexpected causing some method to loop repeatedly.
d) mass amounts of report runs, dashboard or ad hoc views and schedule jobs all occurring at same time.
e) inadequate RAM - this is what we are addressing with the change as the JVM was not properly displayed in the Diagnostics report.

Environment

Release : All supported releases with Jaspersoft 

Component : CA PPM SAAS JASPERSOFT

Resolution

The easiest way to get thread dumps is via command-line on the appserver host, using jstack.exe which is in the bin dir of the JDK.

use ps -ef | grep java to get the pid, find JDK_HOME/bin, then issue cmd:
jstack -l <pid> <file-path>

like jstack -l 37320 > /opt/tmp/threadDump.txt

But you want maybe 5 or 6 across a single minute so we can see what methods might be stuck or active across that whole minute. So perhaps at a few different times during your "hang", you could capture 5 or 6 thread-dumps in 60-seconds worth of time.

It will be best to have these different sections of time in their own file, for example:
like jstack -l pid > /opt/tmp/threadDumpA.txt for 5 or 6 times in a single minute of the hang, then later
do jstack -l pid > /opt/tmp/threadDumpB.txt .... 5 or 6 times, then later
do jstack -l pid > /opt/tmp/threadDumpC.txt

 

Additional Information

If On Premise, also consider the following options:

1. An alternative to get thread-dumps from some means other than cmd line would be hooking up jvisualVM.exe via steps matching this:
https://community.jaspersoft.com/wiki/jconsole-and-jasperreports-server

2. You can also view thread activity in real-time via:
https://community.jaspersoft.com/wiki/using-visual-vm-jasperreports-server-view-call-traces