根据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:
问题是:0.5参数是怎么来的?
答案 0 :(得分:0)
我认为我得到0.5的原因:
最大元素计数为0.75 * bin[].length
,则将调整垃圾箱的大小。
因此,假设元素数为0.5 * bin[].length
,则每个垃圾箱的平均元素数为0.5。