HhashMap HashTable ConcurrentHashMap

hashMap

hashTable

concurrentHashMap

hashMap的效率高于hashTable,hashMap是线程不安全的,并发时hashMap put方法容易引起死循环,导致cpu利用率达到100%

所以高并发下不能使用hashMap,而是用ConcurentHashMap,则不会出现这种情况

原文地址:https://www.cnblogs.com/zhangzhen894095789/p/6628259.html