How to get thread dump and what is the purpose of stuck thread?

@ : Home > > Interview Room
  1. Get the java process id, you can get it by JPS or customized script for it.
  2. Kill -3 pid for Unix Env.
  3. Ctrl+break for windows Env.

When there is a Stuck Thread need to monitor the log for few minutes sometimes 2 or 3 stuck threads logging but after sometime it will be unstacked. If you take multiple thread dump for every 5 sec gap and analyze with samurai or Java Thread Analyzer tool you will get to know why it is stuck what is causing the instances to misbehave that time.

Alert me