3 ms·
It does. It's called lock inflation. The lock data structure is more than just a handful of bits, so the object header can point to the real lock once allocated
by mike_hearn 4y ago
It does. It's called lock inflation. The lock data structure is more than just a handful of bits, so the object header can point to the real lock once allocated. You don't pay a full lock for every object, just the memory needed to determine if it's in use or not.