Beruflich Dokumente
Kultur Dokumente
Program Agenda
1
Performance issues
Performance Issues
Performance Issues
Server hanging
Performance Issues
Issues that could lead to server hang or other severe performance issues
Application code or WLS internal issue
Deadlock
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Performance Issues
Data needed to analyze a performance issue
Server logs, -verbose:gc to print information at every collection
Check for
OutOfMemory
messages
The thread is blocked and can't return to the thread pool in a given period of time
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
If many connections are being opened and closed quickly then socket's in TIME_WAIT may begin to accumulate on
a system
View sockets in TIME_WAIT using netstat
Support Pattern: How To Troubleshoot Too Many Open Files Problems [ID 867492.1]
Support Pattern: Troubleshooting Out of Memory and Memory Leak Problems [ID 877172.1]
A java thread dump is a snapshot that shows what every thread in the JVM
process is doing at a particular point in time
Classes
Packages
Method Calls
Locks
Time Stamp
JVM Info
Stack
Threads
Vendor
Version
Build
Architecture
Mode
State
Name,
Queue
tid, nid, prio
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Unix Command-line
kill -3 <pid>
Jstack <pid>
WLST threadDump()
jcmd <pid>
print_threads
Hotspot JDK 7
Java VisualVM
jcmd
<pid> Thread.print
(Java 7 mission
control)
Description
Samurai
Thread Logic
http://java.net/projects/threadlogic/
Troubleshooting
Thread Dump Analysis Five High level steps
Look at default and custom execute threads
Identity the cause of stuck threads by looking at the last method and java class invoked
Ignore the idle threads
Check thread dumps from different managed servers to find potential relationships between
the stuck threads
In most cases, WLS internal threads, such as muxer and listen threads, can be ignored
oracle.net.ns.DataPacket.receive(Unknown Source)
oracle.net.ns.NetInputStream.getNextPacket(Unknown Source)
oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:420)
oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
java.sql.DriverManager.getConnection(DriverManager.java:140)
com.foo.sbm.util.ConnectionPool.createConnection(Unknown Source)
id (or tid) is the thread identifier, a unique processwide number that identifies this thread within the
JVM process.
nid is the OS-level native thread identifier. It can
be used to correlate with high CPU usage threads
identified at the OS level
idx is the thread index in the threads array.
prio refers to the thread priority, a number
inherited from the thread that created it.
alive refers to the fact that this thread has not
ended yet and is still active.
in native means that the thread uses the operating
system's native ability to manage multi-threaded
processes.
daemon indicates that this thread can't prevent
the JVM from exiting.
Description
Available thread ready to process work request for any work manager
BLOCKED
Thread blocked by another and waiting for the other thread to complete its operations and
release its locks. If more than one threads attempt to acquire the monitor of a particular
object then only one thread (selected by the JVM scheduler) is granted the monitor and all
other threads are put into BLOCKED state
RUNNING
Thread actively working processing a task and therefore using some CPU
TIMED_WAITING
Thread in sleep, wait, join or park method and in a state of monitoring (waiting on monitor
condition) - waiting for another thread to perform an action for up to a specified waiting
time is in this state
WAITING
The thread is waiting by using a wait, join or park method without any maximum - waiting
indefinitely for another thread to perform a particular action is in this state
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Cooperation
Supported via the wait and notify methods of class Object
Enables threads to work together towards a common goal
Package java.util.concurrent
Utility classes commonly useful in concurrent programming
"Thread-1" is sleeping on a
condition after it called
Thread.sleep
Conditions provide a means for one thread to suspend execution and wait until
notified by another thread that some state condition may now be true
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Locks are used to prevent that more than one thread accesses and works the same
object
Only one thread can own a Lock object at a time
Lock objects support a wait/notify mechanism
A lock is called Thin with little or no contention
A lock is promoted to Fat when contention increases
oracle.net.ns.DataPacket.receive(Unknown Source)
oracle.net.ns.NetInputStream.getNextPacket(Unknown Source)
oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:420)
oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
java.sql.DriverManager.getConnection(DriverManager.java:140)
com.foo.sbm.util.ConnectionPool.createConnection(Unknown Source)
at java/io/BufferedInputStream.read(BufferedInputStream.java:235)[optimized]
^-- Holding lock: java/io/BufferedInputStream@0x291bf2b8[thin lock]
at com/sun/mail/util/LineInputStream.readLine(LineInputStream.java:75)
at com/sun/mail/smtp/SMTPTransport.readServerResponse(SMTPTransport.java:1440)
at javax/mail/Service.connect(Service.java:105)
at javax/mail/Transport.send0(Transport.java:168)
A lock is placed on a
BufferInputStream object to
safeguard its content
at netscape.ldap.LDAPMessageQueue.waitFirstMessage(LDAPMessageQueue.java:101)
at weblogic.security.providers.authentication.LDAPAtnDelegate.authenticate(LDAPAtnDelegate.java:3625)
at weblogic.security.providers.authentication.LDAPAtnLoginModuleImpl.login(LDAPAtnLoginModuleImpl.java:220)
at com.bea.common.security.internal.service.LoginModuleWrapper$1.run(LoginModuleWrapper.java:110)
at java.security.AccessController.doPrivileged(Native Method)
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
...
- Holding lock: weblogic/rjvm/ResponseImpl@0x4385fc78[fat lock]
at weblogic/rjvm/ResponseImpl.getTxContext()Ljava/lang/Object;(ResponseImpl.java:100)[inlined]
...
"[ACTIVE] ExecuteThread: '134' for queue: 'weblogic.kernel.Default (self-tuning)'" id=473785 idx=0x398 tid=32638 prio=5 alive, in native, blocked,
daemon
-- Blocked trying to get lock: weblogic/rjvm/ResponseImpl@0x4385fc78[fat lock]
Both threads are currently
blocked waiting to get a lock
at jrockit/vm/Threads.waitForSignal(J)Z(Native Method)
...
^-- Holding lock: weblogic/utils/KeyTable@0x16939098[thin lock]
...
Copyright 2014, Oracle and/or its affiliates. All rights reserved. |
Join us for a relaxing Happy Hour after a busy day at Oracle OpenWorld!
Take a break and unwind with your peers
Copyright 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential Internal/Restricted/Highly Restricted
35