Open gyd-a opened 3 years ago
Hi @gyd-a! Do you have a code sample I can run which reproduces the issue?
In general, there are two ways I can think of to reduce the maximum memory usage of the table:
SLOT_PER_BUCKET
value (the default can be configured in libcuckoo/cuckoohash_config.hh
. Roughly speaking, increasing SLOT_PER_BUCKET
should improve memory utilization (higher load factor) at the cost of slower hashtable operations.Thank you very much. We changed SLOT_PER_BUCKET
from 4 to 8. Memory went from 13GB to 2.2GB. Replay test, unordered_map memory is 1.8g. SLOT_PER_BUCKET
=16 is error. error: static assertion failed: pathcode may not be large enough to encode a cuckoo path static_assert(const_pow(slot_per_bucket(), MAX_BFS_PATH_LEN) <
As the file is relatively large, you can send your email to my email. I will send the file to your email. 1666066431@qq.com
Glad to hear that helped! Regarding the static_assert
error, this is intentional, since we must encode any possible cuckooing path within an integer of size decltype(pathcode)
. You might be able to bump up the maximum SLOT_PER_BUCKET
by changing pathcode
from uint16_t
to say uint64_t
, but I haven't really experimented with this. Again it would be trading performance for memory utilization.