diff --git a/include/rocksdb/utilities/sim_cache.h b/include/rocksdb/utilities/sim_cache.h index 8ccef0560..039c66efd 100644 --- a/include/rocksdb/utilities/sim_cache.h +++ b/include/rocksdb/utilities/sim_cache.h @@ -23,6 +23,14 @@ class SimCache; // to predict block cache hit rate without actually allocating the memory. It // can help users tune their current block cache size, and determine how // efficient they are using the memory. +// +// Since GetSimCapacity() returns the capacity for simulutation, it differs from +// actual memory usage, which can be estimated as: +// sim_capacity * entry_size / (entry_size + block_size), +// where 76 <= entry_size <= 104, +// BlockBasedTableOptions.block_size = 4096 by default but is configurable, +// Therefore, generally the actual memory overhead of SimCache is Less than +// sim_capacity * 2% extern std::shared_ptr NewSimCache( std::shared_ptr cache, size_t sim_capacity, int num_shard_bits, std::shared_ptr stats = nullptr);