Different ways to take thread dumps in WebLogic Server
WebLogic Server (WLS) and Java offer several ways to generate thread dumps, they are detailed below. It is always recommended to obtain the thread dumps by using operating system (OS) commands rather than by using Java classes or the Administration Console, because if the console is hanging, users won't be able to connect to it to issue thread dumps.
- Use operating system commands to get the thread dumps when WLS starts up from a command-line script:
- On Windows OSes, thread dumps can be created by
+ -- the thread dumps are generated in the server stdout - On POSIX-compliant platforms (e.g. Solaris and Linux), first identify the process ID (pid) usingps -ef | grep java, then runkill -3Signal 3 is equivalent to SIGQUIT. Note that in Solaris, the thread dump is generated in the current shell, but in Linux, the thread dump is generated in the shell which started the java process specified by the pid.
2>&1
- On Windows OSes, thread dumps can be created by
- Using beasvc (up to WLS 10.3.5 included):beasvc -dump -svcname:
- service_name is the Windows service that is running the server instance (e.g. mydomain_myserver)
- Using wlsve (from 10.3.6/12.1.1):wlsve -dump -svcname:
- Using weblogic.WLST:setDomain.cmd or setDomain.sh depending on the OSThe thread dump will be generated in Thread_Dump_AdminServer.txt. Note 1274713.1 addresses WLST thread dump in more details with examples on how to define sleep time between each dump and number of dumps to take.
java weblogic.WLST
connect(""," ","t3:// : ")
threadDump() - From a command line or shell, a thread dump can be generated via the following command (deprecated from WLS 9.0):setDomain.cmd or setDomain.sh depending on the OSThe thread dump will be generated in the defined server stdout.
java weblogic.Admin: -username -password THREAD_DUMP - From the WLS Administration Console, a thread dump can be created by navigating to Server ->
-> Monitoring -> Dump threads stack. This method could lead to truncated or incomplete thread dumps. - From the Services Administration Tools when WLS runs as a Windows Service, see Note 1348645.1
- Java VisualVM can also be used to take thread dumps while applications are running, see http://docs.oracle.com/javase/6/docs/technotes/guides/visualvm/applications_local.html for more details
- With jstackjstack
or jstack -l to print additional information about locks - From the JRockit command line:jrcmd
print_threads
No comments:
Post a Comment