THREAD DUMP
•Thread dumps are one of the primary and most resourceful pieces of data used for debugging.
•Can be used in a variety of scenarios for debugging all java based applications.
•Thread dumps primarily used to debug run-time state of a JVM (Java Virtual Machine).
•Thread dump is a real-time snapshot of JVM processing.
•Snapshot of all threads in the JVM process.
•Provides the state of each thread along with the stack trace associated with the same.
•Thread stack contains the method execution sequence that the thread has undertaken till that point in time.
•The stack populates with sequential method execution.
•The stack unwinds when the methods return in a reverse sequence.
•Thread dump reveals information about the application’s thread activity as well.
•Can be used in a variety of scenarios for debugging all java based applications.
•Thread dumps primarily used to debug run-time state of a JVM (Java Virtual Machine).
•Thread dump is a real-time snapshot of JVM processing.
•Snapshot of all threads in the JVM process.
•Provides the state of each thread along with the stack trace associated with the same.
•Thread stack contains the method execution sequence that the thread has undertaken till that point in time.
•The stack populates with sequential method execution.
•The stack unwinds when the methods return in a reverse sequence.
•Thread dump reveals information about the application’s thread activity as well.
THREAD STATES
•NEW – The thread is created, but not yet started.
•RUNNABLE – The thread is currently executing in the JVM.
•BLOCKED – The thread is blocked waiting for a monitor lock.
•WAITING – The thread is waiting indefinitely for another thread to perform some action.
•TIMED_WAITING – The thread is waiting for a specified time for another thread to perform some action
TERMINATED – The thread has exited
•RUNNABLE – The thread is currently executing in the JVM.
•BLOCKED – The thread is blocked waiting for a monitor lock.
•WAITING – The thread is waiting indefinitely for another thread to perform some action.
•TIMED_WAITING – The thread is waiting for a specified time for another thread to perform some action
TERMINATED – The thread has exited
DIFFERENT WAYS TO TAKE THREAD DUMP
Use operating system commands to get the thread dumps when WLS starts up from a command-line script:
The Thread dump will be printed in the cmd prompt where you have started the server
2. Using weblogic.WLST:
setDomain.cmd or setDomain.sh depending on the OS
java weblogic.WLST
connect("<username>","<password>","t3://<url>:<port>")
threadDump()
The thread dump will be generated in Thread_Dump_AdminServer.txt. at the location C:\Oracle\Middleware\wlserver_10.3\common\bin
If you want to take the thread dump of the Managed Server then connect to the managed Server by using the port number of the managed Server and then execute the threadDump Command .
The thread Dump of the Managed Server will be present at the location
The thread dump will be generated in Thread_Dump_MS1.txt. at the location C:\Oracle\Middleware\wlserver_10.3\common\bin
3. Thread Dump can be generated by using the Weblogic Admin utility setDomain.cmd or setDomain.sh depending on the OS
java weblogic.Admin <url>:<port> -username <username> -password <password> THREAD_DUMP
The thread dump will be generated in the defined server stdout.
Command to take thread dump for Admin Server
C:\Oracle\Middleware\user_projects\domains\base_domain>java weblogic.Admin -url
t3://localhost:7001 -username weblogic -password weblogic1 THREAD_DUMP
Command to take thread dump in Managed Server Just change the port number
C:\Oracle\Middleware\user_projects\domains\base_domain>java weblogic.Admin -url
t3://localhost:7003 -username weblogic -password weblogic1 THREAD_DUMP
4..From the WLS Administration Console, a thread dump can be created by navigating toServer -> <server_name> -> Monitoring ->Threads -> Dump threads stack. This method could lead to truncated or incomplete thread dumps
5.With jstack in Sun HotSpot
jstack <pid> or jstack -l <pid> to print additional information about locks
6.From the JRockit command line:
jrcmd <pid> print_threads
Tools for Analysis of Thread dumps
•ThreadLogic - The most powerful tool for thread dump analysis. Useful to mine thread dumps in addition to providing advisories based on pattern analysis. Great support for WLS. Developed by Oracle A-Team.
•Samurai – A pretty old but useful utility to analyze multiple thread dumps.
•Thread Dump analyzers provided by multiple vendors. IBM JCA Thread Analyzer being a good example.
•Notepad – probably the best way to look at thread dumps to try and get to understand the nitty-gritty of analysis.
•Samurai – A pretty old but useful utility to analyze multiple thread dumps.
•Thread Dump analyzers provided by multiple vendors. IBM JCA Thread Analyzer being a good example.
•Notepad – probably the best way to look at thread dumps to try and get to understand the nitty-gritty of analysis.
No comments:
Post a Comment