Patent ID: 8707285

Claim:
A method comprising: loading a software class containing class information for a lock state; allocating an instance of a software object derived from the software class, wherein the allocating includes allocating of a lock word as part of the instance of the software object, the lock word defining whether the object is locked by a thread of multiple threads; observing activity relative to the instance of the software object, wherein observing the activity relative to the instance of the software object comprises observing the activity relative to the instance of the software object for a time period, wherein the activity relative to the instance of the software object that indicates that the lock state of the instance of the software object is non-locking comprises activity that includes a lock count that is below a threshold, wherein the threshold is derived from a number of lock requests for instances of the software class, time, a number of software objects allocated for the software class, and a number of garbage collection cycles processed; and responsive to observing the activity relative to the instance of the software object that indicates that the lock state of the instance of the software object is non-locking, removing the lock word from the instance of the software object.