Java using 100% of CPU

I am using OpenMRS that comes with Bahmni 0.88. My cpu usage is also reaching 100% hence the application is no longer responding.

Bahmni 0.88 comes with JRE 1.8, thus I had to install OpenJDK 1.8 in order to use jstack command. Now when I run the jstackscript.sh I encounter the following

 Unable to open socket file: target process not responding or HotSpot VM not loaded
The -F option can be used when the target process is not responding

Any idea how to solve that? Once I get this working I intend to attach my thread dumps here so can be analyzed by the experts. Many thanks!

I rerun the script and somehow it managed to get thread dumps.

jstack.9974.141833.793677395.txt (681.2 KB) jstack.9974.141802.162487397.txt (701.7 KB) jstack.9974.141855.679997643.txt (751.9 KB)

Can someone have a look at this ? Thanks!