When the dict is being rehashed, if no client accesses the dict for a long time, will the memory of ht[1] never be released? Will this cause the dict to actually occupy two copies of memory but only store one copy of the data?

Comment From: silky1313

The rehash process is only executed when calling the methods dictAddRaw, dictGenericDelete, dictFind, and dictGetRandomKey.

Comment From: sundb

@silky1313 yes, it's possible if it's a hash type key.

Comment From: silky1313

This may cause some memory waste, but it seems that there is no solution at present?

Comment From: sundb

This may cause some memory waste, but it seems that there is no solution at present?

yes, no sulution right now.

Comment From: silky1313

ok, i get it , thanks!

Comment From: ShooterIT

If you know these keys, maybe you can execute HSCAN/ZSCAN* commands to trigger incrementally rehash.

Comment From: ShooterIT

@sundb BTW, now we only have incremental rehash for dicts of main db and expire, maybe we can do that for other big dicts if they are more than specific threshold