ConcurrentHashMap中为什么使用0.5作为泊松分布的参数?

Jas*_*son 6 java concurrenthashmap

根据ConcurrentHashMap中的java文档:

 * Ideally, the frequency of nodes in bins follows a Poisson distribution
 * (http://en.wikipedia.org/wiki/Poisson_distribution) with a
 * parameter of about 0.5 on average, given the resizing threshold
 * of 0.75, although with a large variance because of resizing
 * granularity. Ignoring variance, the expected occurrences of
 * list size k are (exp(-0.5) * pow(0.5, k) / factorial(k)). The
 * first values are:
Run Code Online (Sandbox Code Playgroud)

问题是:0.5这个参数是怎么来的?

Jas*_*son 0

我想我得到了 0.5 的原因:最大元素计数为0.75 * bin[].length,然后 bin 将调整大小。因此,假设元素计数为:0.5 * bin[].length,则每个 bin 的平均元素计数为 0.5。