Spark's BloomFilter implementation uses a formula to calculate the optimal bit size based on the expected number of items and the desired false positive rate. This calculated bit size might not always be exactly equal to the value you might have anticipated. The library aims to provide a good balance between space efficiency and accuracy.