0

Sometimes my application becomes very slow and I don't know why.

I found out that, when this happens, there is also a rather odd increase of the number of threads in the JConsole.

The problem is that I don't know exactly how to pinpoint which threads were created that time and why. Maybe JConsole has a way on doing this for me, but I have no idea.

Does anyone has any clue on how resolving this mistery? JConsole print below. (It happened around 12:00).

JConsole thread print

ViniciusPaiva
  • 151
  • 1
  • 13
  • There really isn't enough information to go on here. You really need to do the leg work. Gather thread dumps before and after the mystery "event" happens and compare them. It'll require a bit of luck / timing / perseverance. Good luck! – jgitter Aug 07 '15 at 19:15
  • How do I gather these thread dumps? The problem is that I don't know how to manipulate this data. – ViniciusPaiva Aug 07 '15 at 19:22
  • You can generate a thread dump with jstack, which is shipped with your JDK. Look in the bin folder. – jgitter Aug 07 '15 at 19:24
  • Thanks! Is this safe to run frequently in production environment? Is it costly on the server? – ViniciusPaiva Aug 07 '15 at 19:28
  • Look here: http://stackoverflow.com/questions/2124672/java-stack-dump-on-windows – Sleafar Aug 07 '15 at 19:28
  • How do you think JConsole is displaying that thread data on your screenshot? That's just the thread dump slightly parsed for convenient presentation. Which means you already _have_ a thread dump. – Marko Topolnik Aug 07 '15 at 20:18
  • You'll probably find that this rise in thread count comes from a thread pool, and the cause is that some number of its threads gets stuck processing a request. The thread pool compensates for that with fresh threads. So use the thread dump to see where the threads may be stuck. – Marko Topolnik Aug 07 '15 at 20:19

0 Answers0