0

We have a java web app running in a server. It is hosted with tomcat. I have enabled Flight recorder and i am able to connect to connect with JMC and recording Flight...

Now, i am not sure how i can find the classes which is making my app slow.Let me be clear, normally the server (60 visitors) is around 10% of CPU usage. But sometimes it becomes very resource hungry and continue to usae almost 100% of CPU (QUADCORE RAM: 16GB). But the visitors are normal, around 60 ... still it behaves like that. I have to restart tomcat.

Now, i want to find the culprit class which is doing these resource hungry situation.

Fahad Ahammed
  • 371
  • 1
  • 11
  • 23

1 Answers1

1

You could open the JMX Console in JMC and create a trigger to dump a recording if the CPU load exceeds 90% or so. Check "when recovering from condition".

When you get a recording, you can in the range navigator on the overview tab select the interval where the CPU spike happened, should be at the end of the recording. Check Synchronise in the top-right corner, and click "Code" in the left pane and you will see overview of the classes / packages where the most hot methods were executing during CPU spike.

Kire Haglin
  • 6,569
  • 22
  • 27