[ https://issues.apache.org/jira/browse/IGNITE-18350?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Denis Chudov updated IGNITE-18350: ---------------------------------- Description: We have two collections, those store lock modes: {code} HeapLockManager.WaiterImpl#locks HeapLockManager.WaiterImpl#intendedLocks {code} That is done for convenient way to implement all lock manager requirement. But for optimization, we can do this through _BitSet_. The redesign is possible because we have predefined lock modes (_LockMode_) and attempts to accesses to the modes are bounded. The amount of attempts significantly less than MaxInt value. The optimization allows using less memory for lock on each entry. Also, using bit masks should limit the count of locks that one transaction can hold on one key. This number of locks should be reasonable, but currently we take intention locks (IS and IX) on tables and indexes on each call of get/put, so count of locks per transaction per key (in this case, key is a table or an index) may reach big numbers depending on a query. was: We have two collections, those store lock modes: {code} HeapLockManager.WaiterImpl#locks HeapLockManager.WaiterImpl#intendedLocks {code} That is done for convenient way to implement all lock manager requirement. But for optimization, we can do this through _BitSet_. The redesign is possible because we have predefined lock modes (_LockMode_) and attempts to accesses to the modes are bounded. The amount of attempts significantly less than MaxInt value. The optimization allows using less memory for lock on each entry. > Redesign two collections of lock modes to a bitset into the heap lock manager > ----------------------------------------------------------------------------- > > Key: IGNITE-18350 > URL: https://issues.apache.org/jira/browse/IGNITE-18350 > Project: Ignite > Issue Type: Improvement > Reporter: Vladislav Pyatkov > Priority: Major > Labels: ignite-3 > > We have two collections, those store lock modes: > {code} > HeapLockManager.WaiterImpl#locks > HeapLockManager.WaiterImpl#intendedLocks > {code} > That is done for convenient way to implement all lock manager requirement. > But for optimization, we can do this through _BitSet_. The redesign is > possible because we have predefined lock modes (_LockMode_) and attempts to > accesses to the modes are bounded. The amount of attempts significantly less > than MaxInt value. > The optimization allows using less memory for lock on each entry. > Also, using bit masks should limit the count of locks that one transaction > can hold on one key. This number of locks should be reasonable, but currently > we take intention locks (IS and IX) on tables and indexes on each call of > get/put, so count of locks per transaction per key (in this case, key is a > table or an index) may reach big numbers depending on a query. -- This message was sent by Atlassian Jira (v8.20.10#820010)