Next: Deadlocks
Up: Monitor Profiling
Previous: Monitor Profiling
Monitor contention is the primary cause of lack of scalability in
multi-processor systems. Monitor contention is typically caused by
multiple threads holding global locks too frequently or too long. To
detect these scenarios, the profiler may enable the following three
types of event notifications:
-
A thread waiting to enter a monitor that is already owned by another
thread issues a MONITOR_CONTENDED_ENTER event. This event
indicates possible performance bottlenecks caused by
frequently-contended monitors.
- After a thread finishes waiting to enter a monitor and acquires the
monitor, it issues a MONITOR_CONTENDED_ENTERED event. This
event indicates the amount of elapsed time the current thread has been
blocked before it enters the monitor.
-
When a thread exits a monitor, and discovers that another thread is
waiting to enter the same monitor, the current thread issues a
MONITOR_CONTENDED_EXIT event. This event indicates possible
performance problems caused by the current thread holding the monitor
for too long.
In all these three cases, overhead of issuing the event is negligible
compared to the performance impact of the blocked monitor operation. The
profiler agent can obtain the stack trace of the current thread and
thus attribute the monitor contention events to the parts of the
program responsible for issuing the monitor operations.
Next: Deadlocks
Up: Monitor Profiling
Previous: Monitor Profiling
Sheng Liang
1998-12-19