-XX:[+|-]GlobalLockReservation
(AIX® and Linux on Power Systems™ only)
The -XX:+GlobalLockReservation
option enables an optimization targeted towards more efficient handling of locking and unlocking Java™ objects. The -XX:-GlobalLockReservation
option is used to disable this optimization. The optimization is enabled by default.
Syntax
-XX:[+|-]GlobalLockReservation
-XX:+GlobalLockReservation:<parameter>
Setting | Effect | Default |
---|---|---|
-XX:+GlobalLockReservation |
Enable | yes |
-XX:-GlobalLockReservation |
Disable |
This optimization is targeted towards applications with lots of uncontended locked objects that are being locked just to be safe. When enabled, heuristics are used to try and determine when an object will be exclusively locked by a single thread so that faster, more specialized code can be used for locking the object. If the heuristics incorrectly identify an object as a target for the optimization, performance might be adversely affected.
The -XX:-GlobalLockReservation
option turns off global lock reservation.
The -XX:+GlobalLockReservation
option can be used to enable global lock reservation if it was disabled by an option that occurs earlier in command line processing or to modify some of the global lock reservation related suboptions that are described later in this document.
Parameters
Advanced tuning parameters are shown in the following table:
Parameter | Effect |
---|---|
reservedTransitionThreshold |
Changes amount of time spent analyzing an object. |
reservedAbsoluteThreshold |
Changes amount of time spent analyzing a class for compatibility. |
minimumReservedRatio |
Changes aggression level for marking a class as highly compatible. |
cancelAbsoluteThreshold |
Changes amount of time spent analyzing a class for incompatibility. |
minimumLearningRatio |
Changes aggression level for marking a class as highly incompatible. |
reservedTransitionThreshold
-XX:+GlobalLockReservation:reservedTransitionThreshold=<value>
-
Setting Value Default <value>
number 1 -
Number of times an object is locked by the same thread before it is considered reserved minus a value of 2. So, with a default value of 1, an object can be reserved the third time it is locked.
<value>
can be 0-3 inclusive. Values of 4 or higher are treated as infinity.
reservedAbsoluteThreshold
-XX:+GlobalLockReservation:reservedAbsoluteThreshold=<value>
-
Setting Value Default <value>
number 10 -
Minimum number of objects of a class that get reserved before the class can be considered highly compatible. Objects of that class are reserved the first time they are locked. Values of 65536 or higher are treated as infinity.
minimumReservedRatio
-XX:+GlobalLockReservation:minimumReservedRatio=<value>
-
Setting Value Default <value>
number 1024 -
Minimum ratio of reserved objects to flat objects before a class can be considered highly compatible. Values of 65536 or higher are treated as infinity.
cancelAbsoluteThreshold
-XX:+GlobalLockReservation:cancelAbsoluteThreshold=<value>
-
Setting Value Default <value>
number 10 -
Minimum number of objects of a class that get converted to flat before the class can be considered highly incompatible. Objects of that class are never reserved. Values of 65536 or higher are treated as infinity.
minimumLearningRatio
-XX:+GlobalLockReservation:minimumLearningRatio=<value>
-
Setting Value Default <value>
number 256 -
Minimum ratio of reserved objects to flat objects to prevent class from being considered highly incompatible. Values of 65536 or higher are treated as infinity.