Baqend / Orestes-Bloomfilter

Library of different Bloom filters in Java with optional Redis-backing, counting and many hashing options.
Other
843 stars 245 forks source link

How to calculate the redis memory usage of CountingBloomFilterRedis #58

Open techzhou opened 5 years ago

techzhou commented 5 years ago

For example,

new FilterBuilder(1000000, 1e-5)

when it full (added 1000000 elements)

how much memory it cost. is there any calculation method?

kangwen commented 3 years ago

N (added elements , 1000000 eg.) f (falseProbability, 1e-5 eg.) M (total bit): M = - N ln(f) / ln2^2.
K(hash functions): K = max(1, ln2
M/N)