concurrenthashmap什么时候扩容
时间: 2023-10-18 22:27:57 浏览: 91
ConcurrentHashMap的扩容是在添加数据时触发的。具体来说,当CHM中容纳的元素数量超过了当前哈希表长度的0.75时,就会触发扩容检查。如果发现需要扩容,CHM会启动扩容过程来重新分配元素并调整内部数据结构,以保持较高的并发性能。需要注意的是,在扩容过程中,CHM会逐段进行迁移操作而不会对整个哈希表进行全局锁定,这使得CHM可以在扩容过程中保持较高的并发性能。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [Java ConcurrentHashMap的扩容过程详解](https://blog.csdn.net/a772304419/article/details/131012692)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *2* *3* [ConcurrentHashMap的扩容](https://blog.csdn.net/pc_fly/article/details/125108562)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文