Do not confuse lock delay with the time spent in the java.lang.Object.wait() method, or with the time spent by a given thread within a Java monitor.

Lock metrics are produced only by the -Xeprofprofiling option.

Note that the lock metrics do not show individual locks, but only values accumulated over all locks used by a given method. Most methods, however, contain only one synchronization statement or none at all, so identifying the contended lock should be easy if the source code is available.

Uncontested locks remain unprofiled for two reasons:

Many locks are in use by a Java program, not always as the programmer's conscious choice. For example, a java.util.Hashtable object used exclusively by only one thread or accessed within a monitor, may be “synchronized” upon multiple times, yet with today's advanced JVM technologies this behavior creates no penalty for the application performance. Lock claims for such objects are not helpful to present.

Because of the ubiquitous synchronization in many Java standard packages, profiling all locks would be detrimental to the profiler's performance.

This section contains some metrics derived from other metrics. The derived metrics are marked by an asterisk (*). They are usually less frequently used, as they not always are immediately useful in detecting performance bottlenecks. For each metric that presents the average values per call, only methods called at least twice are taken into account.

The following metrics are available.

Contested Lock Claims by Method

The number of all attempts by individual methods to acquire a Java monitor lock while the lock was being held by another thread, thus entailing a delay, even if only a very short one.

Related Topics

Mark an Item for Search (page 178)

Find a Search Pattern (page 179)

All Lock Claims by Method

The number of all Java monitor locks acquisitions by individual methods. The data is inherently incomplete, because the metric is accumulated only since the first lock conflict for each lock. You will see “partial data)” displayed after the metric label.

Related Topics

Mark an Item for Search (page 178)

Find a Search Pattern (page 179)

Lock Delay - Method Exclusive

Accumulated lock delay, wasted in the method acquiring the lock(s). The lock delay is the time between an attempt to get the lock and the actual acquisition of the lock.

Related Topics

Inclusive Versus Exclusive Time (page 69)

Mark an Item for Search (page 178)

Find a Search Pattern (page 179)

Lock Delay - Call Graph Tree

The inclusive lock delay shown on the call graph. Be sure to read the page on using the trees.

Related Topics

Using Call Graph Trees (page 75)

Inclusive Versus Exclusive Time (page 69)

154 Using Visualizer Functions