How to capture Thread Dumps using jstack utility for TIBCO Data Virtualization running on Linux?

How to capture Thread Dumps using jstack utility for TIBCO Data Virtualization running on Linux?

book

Article ID: KB0071552

calendar_today

Updated On:

Products Versions
TIBCO Data Virtualization All supported versions

Description

This article outlines the steps to capture the Thread dumps for TIBCO Data Virtualization(TDV) Server process using the jstack utility. 

Issue/Introduction

How to capture Thread Dumps using jstack utility for TIBCO Data Virtualization running on Linux?

Environment

Linux Operating Systems

Resolution

1. Obtain the PID (process ID) of the TDV Server by running the following command from a terminal - 

-bash-4.2$ ps -ef | grep ServerBoot
Sample output - 
===
-bash-4.2$ ps -ef | grep ServerBoot
plasanpu  21452  21402  0 Mar28 ?  00:21:11 /TIBCO/TDV_Server_8.4.3_1900/jdk/bin/java -Ddrill.java.home=/TIBCO/TDV_Server_8.4.3_1900/jdk -server -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/TIBCO/TDV_Server_8.4.3_1900/logs -XX:+UseG1GC -XX:MaxGCPauseMillis=200 -Xmx2048m -Djava.library.path=/TIBCO/TDV_Server_8.4.3_1900/apps/server/lib/svn/lin64 --add-exports=java.base/sun.security.provider=ALL-UNNAMED --add-exports=java.security.jgss/sun.security.krb5=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-exports=java.base/sun.nio.ch=ALL-UNNAMED --add-exports=java.base/jdk.internal.ref=ALL-UNNAMED --add-exports=java.base/sun.net. www.protocol.file=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.xml/com.sun.org.apache.xerces.internal.util=ALL-UNNAMED -Dfile.encoding=UTF-8 - Dorg.apache.commons.logging.log.com.sun.xml.rpc=error -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger -Dlog4j2.configurationFile=/TIBCO/TDV_Server_8.4.3_1900/conf/server/log4j2.properties -Djava.security.properties=/TIBCO/TDV_Server_8.4.3_1900/conf/server/security/java.security -Dorg.eclipse.jetty.xml.XmlParser.Validating=false -Dorg.eclipse.jetty.servlet.SessionCookie=JSESSIONID:9400 -Dorg.apache.xml.dtm.DTMManager=com.compositesw.xml.dtm.pdtm.ProxyDTMMgrImpl -Dorg.apache.xml.utils.AbstractDOMBuilder=com.compositesw.xml.dtm.pdtm.ProxyDOMBuilder -Dcom.sun.xml.rpc.streaming.XMLReaderFactory=com.compositesw.cdms.webapi.rpc.XMLReaderFactoryImpl -Dzookeeper.admin.enableServer=false - Dcom.sun.org.apache.xml.internal.security.resource.config=resource/config.xml -Djava.specification.version=11 -Dhadoop.metrics.init.mode=standby -Dhadoop.home.dir=/TIBCO/TDV_Server_8.4.3_1900/apps/server/lib/winutils -Dzookeeper.jmx.log4j.disable=true -Dapps.install.dir=/TIBCO/TDV_Server_8.4.3_1900 -Dconf.install.dir=/TIBCO/TDV_Server_8.4.3_1900 -classpath /TIBCO/TDV_Server_8.4.3_1900/apps/base/lib/bcpkix-jdk15on-1.69.jar:/TIBCO/TDV_Server_8.4.3_1900/apps/base/lib/bcprov-jdk15on-1.69.jar:/TIBCO/TDV_Server_8.4.3_1900/apps/base/lib/csbase.jar com.compositesw.base.boot.ServerBoot run
===
Screenshot for reference:

User-added image

Here PID is 21452.

2. Navigate to the [TDV_Server_dir]\jdk\bin path where jstack utility is present:

Command to capture the dumps -> ./jstack pid > filename.txt
Note:
- In-place of pid, provide the pid obtained in step1.
- Give a name for the thread dump file. This will save contents to a file inside the same directory. 

Example: ./jstack 21452 > Threaddump1.txt

Screenshot for reference:
User-added image

This will save the thread dump file in the present working directory. 

To verify the thread dump is of the TDV Server process: the last line of the "main" thread would be "com.compositesw.base.boot.ServerBoot.main" as illustrated below : 

 "main" #1 prio=5 os_prio=0 cpu=65427.62ms elapsed=168553.30s tid=0x00007fe414025800 nid=0x53cd in Object.wait()  [0x00007fe41be7c000]    java.lang.Thread.State: WAITING (on object monitor) 	at java.lang.Object.wait(java.base@11.0.15/Native Method) 	- waiting on <no object reference available> 	at java.lang.Object.wait(java.base@11.0.15/Object.java:328) 	at com.compositesw.server.services.CompositeServer.startServer(CompositeServer.java:1414) 	- waiting to re-lock in wait() <0x0000000080ecc538> (a java.lang.Class for com.compositesw.server.services.CompositeServer) 	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@11.0.15/Native Method) 	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@11.0.15/NativeMethodAccessorImpl.java:62) 	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@11.0.15/DelegatingMethodAccessorImpl.java:43) 	at java.lang.reflect.Method.invoke(java.base@11.0.15/Method.java:566) 	at com.compositesw.base.boot.ServerBoot.main(ServerBoot.java:89)