How To Obtain A Thread dump Just In Time Rather Than Kill -QUIT ?
(Doc ID 1262814.1)
Last updated on SEPTEMBER 08, 2022
Applies to:Oracle Containers for J2EE - Version 184.108.40.206.0 to 10.1.3.5.0 [Release AS10g to AS10gR3]
Information in this document applies to any platform.
In some situations, in order to identify the problematic tasks / threads in a dynamic environment, it is very helpful if an immediate thread dump can be generated of the current running tasks.
Those situations refer to multiple threads, concurrent tasks running and shared resources. However, it is very difficult to capture a snapshot at some point for the threads activities, not even the commonly used command: kill -QUIT <pid>. That is because the requirement might be to obtain a thread dump right after issuing a certain task (e.g. URL request), in other words, there is a time cap between issuing a task and the "kill -QUIT" command.
There is another situation where "kill -QUIT" can not be applied, in a non Unix platform such as Windows, the "kill" command does not even exist; besides, it may not be feasible to issue "Ctl - break" in some scenarios, for example, with Oracle application server, after started the oc4j container, the process is detached, hence, there is no any place to allow to issue the "Ctl - break".
In above situations, one may use the Java Debugger (JDB) to generate a thread dump. The JDB is a simple command-line debugger for Java classes and threads, and provides inspection and debugging of a local or remote Java Virtual Machine. It allows to stop all thread activities temporarily, dump an immediate thread traces, and resume all threads later. So it fits the situation mentioned above:
- not able to capture a snapshot of jvm thread activities.
- not able to send a signal to jvm for creating a thread dump.
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!
In this Document