September 2011
Intermediate to advanced
528 pages
19h 57m
English
The JVM uses two types of locks—thin locks that are helpful for brief periods and fat locks that are held when there's contention for resources. Threads sleep during a fat lock and spin during a think lock, thus making fat locks less resource intensive because spinning uses up CPU cycles. You can use the command -Xverbose:locks to view information about the JVM locks. You can enable locking instrumentation by using the following command:
-XX:UseLockProfiling=true
The preceding command shows details about the number and types of locks held by the JVM. You can enable the collection of locking information by the JRockit Runtime Analyzer using the following option at startup time:
-Djrockit.lockprofiling=true
Using Lock ...
Read now
Unlock full access