The LockRegistry currently doesn't clean up any of its keys. That means that as new locks are acquired, the memory utilization for the lock registry must also grow, and garbage collection will not help. This is not so bad, though, as the LockRegistry is bound to a single transaction. So, at the very least, we'll have a chance to mark those objects as ready for garbage collection at the end of a transaction. Still, it would be nice to avoid growing the locks data structure if we can avoid it.
The
LockRegistrycurrently doesn't clean up any of its keys. That means that as new locks are acquired, the memory utilization for the lock registry must also grow, and garbage collection will not help. This is not so bad, though, as theLockRegistryis bound to a single transaction. So, at the very least, we'll have a chance to mark those objects as ready for garbage collection at the end of a transaction. Still, it would be nice to avoid growing the locks data structure if we can avoid it.