In my company, I've been asked to find out why an application of the intranet, from time to time, consumes 100% of the CPU time and gets stuck there. The server is a legacy system, which uses CentOS 6.7, JBoss 4.2.2 GA and JDK 1.5.0 Update 22. The application is an ERP running in JBoss.
The first thing that I've done is to use the command top -H -p <pid> to find out which thread was the one exhausting the CPU and see what . Then, I've run jstack <pid> to get a thread dump and associate the PID of the thread at the OS level, with the thread ID or name at the JVM level. However, this version of Java is old and doesn't show the PID at the OS level (in hexadecimal), as newer versions do. It even doesn't show the actual thread name, just a generic name of the form "Thread XXXXX". Is there a way to do this association in this version of Java? If so, How?
I've also accessed the JMX Console provided by JBoss, using a web browser. I hadn't used this version for years, but I've found something interesting under jboss.system:type=ServerInfo. This MBean provides a method called listThreadCpuUtilization() which is close to what I need. But it doesn't show the CPU usage in a given time interval, but the total usage since each thread was created. So I've created a shell script that queries this MBean every X seconds and calculates the usage in such interval. What's the problem now? That the JMX Console remains inaccessible when the ERP exhausts the CPU. So it's not much helpful.
Since the machine has a X server running in it, I've also tried to run JConsole and VisualVM. JConsole says that the JBoss process is not a managed VM. VisualVM lists the process, but gets stuck when I want to see the details.
Can you help me, please?
We noticed he had no friends. So we gave him this tiny ad:
global solutions you can do at home or in your backyard