deniskuzZ commented on code in PR #6651:
URL: https://github.com/apache/hive/pull/6651#discussion_r3665302494
##########
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/BaseHandler.java:
##########
@@ -271,7 +271,10 @@ private void initDefaultSchema() throws MetaException {
if (tablelocks == null) {
int numTableLocks = MetastoreConf.getIntVar(conf,
MetastoreConf.ConfVars.METASTORE_NUM_STRIPED_TABLE_LOCKS);
- tablelocks = Striped.lock(numTableLocks);
+ // lazyWeakLock: lock objects are allocated on first use and held via
weak references,
+ // so unused stripes are GC'd. A large stripe count keeps hash
collisions between
+ // unrelated (db, tbl) keys without paying permanent memory cost.
+ tablelocks = Striped.lazyWeakLock(numTableLocks);
Review Comment:
cc @dengzhhu653
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]