Taking periodic thread dumps on Linux

Talend Version          6.2.1

Summary

This article describes a way to take periodic thread dumps on a Linux machine for analysis.
Additional Versions 6.1.1,6.0.1
Key words thread,dump,jstack,script,linux,unix
Product Talend Data Quality
Component Talend Administration Center
Article Type Debugging
Problem Description

Using graphical tools to view and collect thread dumps on Linux machines is not always possible, either because there is no UI, or you may only have SSH access.

Problem root cause  
Solution or Workaround

Collect periodic thread dumps using a script/cron job using the following steps:

  1. Restart TAC, then get the pid of the java process corresponding to TAC:

    ps fax | grep java
  2. Run the following command every few minutes and write the output to a file:

    jstack pid > threaddump-n.log

    Note: you can set up a cron job or a script to do this every few minutes. For example:

    while true; do d=`date +%Y%m%d-%H%M%S`; `jstack pid > "threaddump-$d.tdump"`;sleep 15m;done 
JIRA ticket number  
Version history
Revision #:
4 of 4
Last update:
‎07-11-2017 04:06 PM
Updated by:
 
Tags (2)