Biased Locking
Biased locking is a synchronization optimization used by the Java HotSpot VM and other managed runtimes to reduce the overhead of uncontended lock acquisition. The heuristic assumes that most objects are locked by only one thread during their lifetime; when this assumption holds, the VM uses a lightweight bias mechanism that makes subsequent lock acquisitions by the same thread nearly free. If another thread attempts to acquire a biased lock, the VM must first revoke the bias — a relatively expensive operation that proves the optimization's cost model correct only when the single-thread assumption is predominantly true. Biased locking is the runtime's gamble that contention is rare enough to make optimistic assumptions profitable, and its retirement in modern JDK versions reflects a shifting workload landscape where multicore contention is no longer the exception.
See also: Lock Elision, Concurrency, Java HotSpot VM
Related: Monitor (synchronization), Thin Lock