{"id":2872,"date":"2018-06-17T14:02:59","date_gmt":"2018-06-17T06:02:59","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=2872"},"modified":"2018-06-17T14:02:59","modified_gmt":"2018-06-17T06:02:59","slug":"java-hashmap-%e7%9a%84%e6%ad%bb%e5%be%aa%e7%8e%afhashmap-infinite-loop","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=2872","title":{"rendered":"Java HashMap \u7684\u6b7b\u5faa\u73af(HashMap Infinite Loop)"},"content":{"rendered":"<p>\n\t\u5728\u6dd8\u5b9d\u5185\u7f51\u91cc\u770b\u5230\u540c\u4e8b\u53d1\u4e86\u8d34\u8bf4\u4e86\u4e00\u4e2aCPU\u88ab100%\u7684\u7ebf\u4e0a\u6545\u969c\uff0c\u5e76\u4e14\u8fd9\u4e2a\u4e8b\u53d1\u751f\u4e86\u5f88\u591a\u6b21\uff0c\u539f\u56e0\u662f\u5728Java\u8bed\u8a00\u5728\u5e76\u53d1\u60c5\u51b5\u4e0b\u4f7f\u7528HashMap\u9020\u6210Race Condition\uff0c\u4ece\u800c\u5bfc\u81f4\u6b7b\u5faa\u73af\u3002\u8fd9\u4e2a\u4e8b\u60c5\u62114\u30015\u5e74\u524d\u4e5f\u7ecf\u5386\u8fc7\uff0c\u672c\u6765\u89c9\u5f97\u6ca1\u4ec0\u4e48\u597d\u5199\u7684\uff0c\u56e0\u4e3aJava\u7684HashMap\u662f\u975e\u7ebf\u7a0b\u5b89\u5168\u7684\uff0c\u6240\u4ee5\u5728\u5e76\u53d1\u4e0b\u5fc5\u7136\u51fa\u73b0\u95ee\u9898\u3002\u4f46\u662f\uff0c\u6211\u53d1\u73b0\u8fd1\u51e0\u5e74\uff0c\u5f88\u591a\u4eba\u90fd\u7ecf\u5386\u8fc7\u8fd9\u4e2a\u4e8b\uff08\u5728\u7f51\u4e0a\u67e5&ldquo;HashMap Infinite Loop&rdquo;\u53ef\u4ee5\u770b\u5230\u5f88\u591a\u4eba\u90fd\u5728\u8bf4\u8fd9\u4e2a\u4e8b\uff09\u6240\u4ee5\uff0c\u89c9\u5f97\u8fd9\u4e2a\u662f\u4e2a\u666e\u904d\u95ee\u9898\uff0c\u9700\u8981\u5199\u7bc7\u75ab\u82d7\u6587\u7ae0\u8bf4\u4e00\u4e0b\u8fd9\u4e2a\u4e8b\uff0c\u5e76\u4e14\u7ed9\u5927\u5bb6\u770b\u770b\u4e00\u4e2a\u5b8c\u7f8e\u7684&ldquo;Race Condition&rdquo;\u662f\u600e\u4e48\u5f62\u6210\u7684\u3002\n<\/p>\n<h2>\n\t\u95ee\u9898\u7684\u75c7\u72b6<br \/>\n<\/h2>\n<p>\n\t\u4ece\u524d\u6211\u4eec\u7684Java\u4ee3\u7801\u56e0\u4e3a\u4e00\u4e9b\u539f\u56e0\u4f7f\u7528\u4e86HashMap\u8fd9\u4e2a\u4e1c\u897f\uff0c\u4f46\u662f\u5f53\u65f6\u7684\u7a0b\u5e8f\u662f\u5355\u7ebf\u7a0b\u7684\uff0c\u4e00\u5207\u90fd\u6ca1\u6709\u95ee\u9898\u3002\u540e\u6765\uff0c\u6211\u4eec\u7684\u7a0b\u5e8f\u6027\u80fd\u6709\u95ee\u9898\uff0c\u6240\u4ee5\u9700\u8981\u53d8\u6210\u591a\u7ebf\u7a0b\u7684\uff0c\u4e8e\u662f\uff0c\u53d8\u6210\u591a\u7ebf\u7a0b\u540e\u5230\u4e86\u7ebf\u4e0a\uff0c\u53d1\u73b0\u7a0b\u5e8f\u7ecf\u5e38\u5360\u4e86100%\u7684CPU\uff0c\u67e5\u770b\u5806\u6808\uff0c\u4f60\u4f1a\u53d1\u73b0\u7a0b\u5e8f\u90fdHang\u5728\u4e86HashMap.get()\u8fd9\u4e2a\u65b9\u6cd5\u4e0a\u4e86\uff0c\u91cd\u542f\u7a0b\u5e8f\u540e\u95ee\u9898\u6d88\u5931\u3002\u4f46\u662f\u8fc7\u6bb5\u65f6\u95f4\u53c8\u4f1a\u6765\u3002\u800c\u4e14\uff0c\u8fd9\u4e2a\u95ee\u9898\u5728\u6d4b\u8bd5\u73af\u5883\u91cc\u53ef\u80fd\u5f88\u96be\u91cd\u73b0\u3002\n<\/p>\n<p>\n\t\u6211\u4eec\u7b80\u5355\u7684\u770b\u4e00\u4e0b\u6211\u4eec\u81ea\u5df1\u7684\u4ee3\u7801\uff0c\u6211\u4eec\u5c31\u77e5\u9053HashMap\u88ab\u591a\u4e2a\u7ebf\u7a0b\u64cd\u4f5c\u3002\u800cJava\u7684\u6587\u6863\u8bf4HashMap\u662f\u975e\u7ebf\u7a0b\u5b89\u5168\u7684\uff0c\u5e94\u8be5\u7528ConcurrentHashMap\u3002\n<\/p>\n<p>\n\t\u4f46\u662f\u5728\u8fd9\u91cc\u6211\u4eec\u53ef\u4ee5\u6765\u7814\u7a76\u4e00\u4e0b\u539f\u56e0\u3002\n<\/p>\n<h2>\n\tHash\u8868\u6570\u636e\u7ed3\u6784<br \/>\n<\/h2>\n<p>\n\t\u6211\u9700\u8981\u7b80\u5355\u5730\u8bf4\u4e00\u4e0bHashMap\u8fd9\u4e2a\u7ecf\u5178\u7684\u6570\u636e\u7ed3\u6784\u3002\n<\/p>\n<p>\n\tHashMap\u901a\u5e38\u4f1a\u7528\u4e00\u4e2a\u6307\u9488\u6570\u7ec4\uff08\u5047\u8bbe\u4e3atable[]\uff09\u6765\u505a\u5206\u6563\u6240\u6709\u7684key\uff0c\u5f53\u4e00\u4e2akey\u88ab\u52a0\u5165\u65f6\uff0c\u4f1a\u901a\u8fc7Hash\u7b97\u6cd5\u901a\u8fc7key\u7b97\u51fa\u8fd9\u4e2a\u6570\u7ec4\u7684\u4e0b\u6807i\uff0c\u7136\u540e\u5c31\u628a\u8fd9\u4e2a\u63d2\u5230table[i]\u4e2d\uff0c\u5982\u679c\u6709\u4e24\u4e2a\u4e0d\u540c\u7684key\u88ab\u7b97\u5728\u4e86\u540c\u4e00\u4e2ai\uff0c\u90a3\u4e48\u5c31\u53eb\u51b2\u7a81\uff0c\u53c8\u53eb\u78b0\u649e\uff0c\u8fd9\u6837\u4f1a\u5728table[i]\u4e0a\u5f62\u6210\u4e00\u4e2a\u94fe\u8868\u3002\n<\/p>\n<p>\n\t\u6211\u4eec\u77e5\u9053\uff0c\u5982\u679ctable[]\u7684\u5c3a\u5bf8\u5f88\u5c0f\uff0c\u6bd4\u5982\u53ea\u67092\u4e2a\uff0c\u5982\u679c\u8981\u653e\u8fdb10\u4e2akeys\u7684\u8bdd\uff0c\u90a3\u4e48\u78b0\u649e\u975e\u5e38\u9891\u7e41\uff0c\u4e8e\u662f\u4e00\u4e2aO(1)\u7684\u67e5\u627e\u7b97\u6cd5\uff0c\u5c31\u53d8\u6210\u4e86\u94fe\u8868\u904d\u5386\uff0c\u6027\u80fd\u53d8\u6210\u4e86O(n)\uff0c\u8fd9\u662fHash\u8868\u7684\u7f3a\u9677\uff08\u53ef\u53c2\u770b\u300aHash Collision DoS \u95ee\u9898\u300b\uff09\u3002\n<\/p>\n<p>\n\t\u6240\u4ee5\uff0cHash\u8868\u7684\u5c3a\u5bf8\u548c\u5bb9\u91cf\u975e\u5e38\u7684\u91cd\u8981\u3002\u4e00\u822c\u6765\u8bf4\uff0cHash\u8868\u8fd9\u4e2a\u5bb9\u5668\u5f53\u6709\u6570\u636e\u8981\u63d2\u5165\u65f6\uff0c\u90fd\u4f1a\u68c0\u67e5\u5bb9\u91cf\u6709\u6ca1\u6709\u8d85\u8fc7\u8bbe\u5b9a\u7684thredhold\uff0c\u5982\u679c\u8d85\u8fc7\uff0c\u9700\u8981\u589e\u5927Hash\u8868\u7684\u5c3a\u5bf8\uff0c\u4f46\u662f\u8fd9\u6837\u4e00\u6765\uff0c\u6574\u4e2aHash\u8868\u91cc\u7684\u65e0\u7d20\u90fd\u9700\u8981\u88ab\u91cd\u7b97\u4e00\u904d\u3002\u8fd9\u53ebrehash\uff0c\u8fd9\u4e2a\u6210\u672c\u76f8\u5f53\u7684\u5927\u3002\n<\/p>\n<p>\n\t\u76f8\u4fe1\u5927\u5bb6\u5bf9\u8fd9\u4e2a\u57fa\u7840\u77e5\u8bc6\u5df2\u7ecf\u5f88\u719f\u6089\u4e86\u3002\n<\/p>\n<h2>\n\tHashMap\u7684rehash\u6e90\u4ee3\u7801<br \/>\n<\/h2>\n<p>\n\t\u4e0b\u9762\uff0c\u6211\u4eec\u6765\u770b\u4e00\u4e0bJava\u7684HashMap\u7684\u6e90\u4ee3\u7801\u3002\n<\/p>\n<p>\n\tPut\u4e00\u4e2aKey,Value\u5bf9\u5230Hash\u8868\u4e2d\uff1a\n<\/p>\n<pre class=\"brush:java;\">\r\npublic V put(K key, V value)\r\n{\r\n    ......\r\n    \/\/\u7b97Hash\u503c\r\n    int hash = hash(key.hashCode());\r\n    int i = indexFor(hash, table.length);\r\n    \/\/\u5982\u679c\u8be5key\u5df2\u88ab\u63d2\u5165\uff0c\u5219\u66ff\u6362\u6389\u65e7\u7684value \uff08\u94fe\u63a5\u64cd\u4f5c\uff09\r\n    for (Entry&lt;K,V&gt; e = table[i]; e != null; e = e.next) {\r\n        Object k;\r\n        if (e.hash == hash &amp;&amp; ((k = e.key) == key || key.equals(k))) {\r\n            V oldValue = e.value;\r\n            e.value = value;\r\n            e.recordAccess(this);\r\n            return oldValue;\r\n        }\r\n    }\r\n    modCount++;\r\n    \/\/\u8be5key\u4e0d\u5b58\u5728\uff0c\u9700\u8981\u589e\u52a0\u4e00\u4e2a\u7ed3\u70b9\r\n    addEntry(hash, key, value, i);\r\n    return null;\r\n}<\/pre>\n<p>\n\t\u68c0\u67e5\u5bb9\u91cf\u662f\u5426\u8d85\u6807\n<\/p>\n<pre class=\"brush:java;\">\r\nvoid addEntry(int hash, K key, V value, int bucketIndex)\r\n{\r\n    Entry&lt;K,V&gt; e = table[bucketIndex];\r\n    table[bucketIndex] = new Entry&lt;K,V&gt;(hash, key, value, e);\r\n    \/\/\u67e5\u770b\u5f53\u524d\u7684size\u662f\u5426\u8d85\u8fc7\u4e86\u6211\u4eec\u8bbe\u5b9a\u7684\u9608\u503cthreshold\uff0c\u5982\u679c\u8d85\u8fc7\uff0c\u9700\u8981resize\r\n    if (size++ &gt;= threshold)\r\n        resize(2 * table.length);\r\n}<\/pre>\n<p>\n\t\u65b0\u5efa\u4e00\u4e2a\u66f4\u5927\u5c3a\u5bf8\u7684hash\u8868\uff0c\u7136\u540e\u628a\u6570\u636e\u4ece\u8001\u7684Hash\u8868\u4e2d\u8fc1\u79fb\u5230\u65b0\u7684Hash\u8868\u4e2d\u3002\n<\/p>\n<pre class=\"brush:java;\">\r\nvoid resize(int newCapacity)\r\n{\r\n    Entry[] oldTable = table;\r\n    int oldCapacity = oldTable.length;\r\n    ......\r\n    \/\/\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Hash Table\r\n    Entry[] newTable = new Entry[newCapacity];\r\n    \/\/\u5c06Old Hash Table\u4e0a\u7684\u6570\u636e\u8fc1\u79fb\u5230New Hash Table\u4e0a\r\n    transfer(newTable);\r\n    table = newTable;\r\n    threshold = (int)(newCapacity * loadFactor);\r\n}<\/pre>\n<p>\n\t\u8fc1\u79fb\u7684\u6e90\u4ee3\u7801\uff0c\u6ce8\u610f12\u300114\u300115\u300116\u8fd9\u51e0\u884c\uff1a\n<\/p>\n<pre class=\"brush:java;\">\r\nvoid transfer(Entry[] newTable)\r\n{\r\n    Entry[] src = table;\r\n    int newCapacity = newTable.length;\r\n    \/\/\u4e0b\u9762\u8fd9\u6bb5\u4ee3\u7801\u7684\u610f\u601d\u662f\uff1a\r\n    \/\/  \u4eceOldTable\u91cc\u6458\u4e00\u4e2a\u5143\u7d20\u51fa\u6765\uff0c\u7136\u540e\u653e\u5230NewTable\u4e2d\r\n    for (int j = 0; j &lt; src.length; j++) {\r\n        Entry&lt;K,V&gt; e = src[j];\r\n        if (e != null) {\r\n            src[j] = null;\r\n            do {\r\n                Entry&lt;K,V&gt; next = e.next;\r\n                int i = indexFor(e.hash, newCapacity);\r\n                e.next = newTable[i];\r\n                newTable[i] = e;\r\n                e = next;\r\n            } while (e != null);\r\n        }\r\n    }\r\n}<\/pre>\n<p>\n\t\u597d\u4e86\uff0c\u8fd9\u4e2a\u4ee3\u7801\u7b97\u662f\u6bd4\u8f83\u6b63\u5e38\u7684\u3002\u800c\u4e14\u6ca1\u6709\u4ec0\u4e48\u95ee\u9898\u3002\n<\/p>\n<h2>\n\t\u6b63\u5e38\u7684ReHash\u7684\u8fc7\u7a0b<br \/>\n<\/h2>\n<p>\n\t\u753b\u4e86\u4e2a\u56fe\u505a\u4e86\u4e2a\u6f14\u793a\u3002\n<\/p>\n<ul>\n<li>\n\t\t\u6211\u5047\u8bbe\u4e86\u6211\u4eec\u7684hash\u7b97\u6cd5\u5c31\u662f\u7b80\u5355\u7684\u7528key mod \u4e00\u4e0b\u8868\u7684\u5927\u5c0f\uff08\u4e5f\u5c31\u662f\u6570\u7ec4\u7684\u957f\u5ea6\uff09\u3002\n\t<\/li>\n<\/ul>\n<ul>\n<li>\n\t\t\u6700\u4e0a\u9762\u7684\u662fold hash \u8868\uff0c\u5176\u4e2d\u7684Hash\u8868\u7684size=2, \u6240\u4ee5key = 3, 7, 5\uff0c\u5728mod 2\u4ee5\u540e\u90fd\u51b2\u7a81\u5728table[1]\u8fd9\u91cc\u4e86\u3002\n\t<\/li>\n<\/ul>\n<ul>\n<li>\n\t\t\u63a5\u4e0b\u6765\u7684\u4e09\u4e2a\u6b65\u9aa4\u662fHash\u8868 resize\u62104\uff0c\u7136\u540e\u6240\u6709\u7684&lt;key,value&gt; \u91cd\u65b0rehash\u7684\u8fc7\u7a0b\n\t<\/li>\n<\/ul>\n<p>\n\t<img decoding=\"async\" alt=\"HashMap\" src=\"https:\/\/coolshell.cn\/wp-content\/uploads\/2013\/05\/HashMap01.jpg\" style=\"width: 623px;height: 462px\" \/>\n<\/p>\n<h2>\n\t\u5e76\u53d1\u4e0b\u7684Rehash<br \/>\n<\/h2>\n<p>\n\t<strong>1\uff09\u5047\u8bbe\u6211\u4eec\u6709\u4e24\u4e2a\u7ebf\u7a0b\u3002<\/strong>\u6211\u7528\u7ea2\u8272\u548c\u6d45\u84dd\u8272\u6807\u6ce8\u4e86\u4e00\u4e0b\u3002\n<\/p>\n<p>\n\t\u6211\u4eec\u518d\u56de\u5934\u770b\u4e00\u4e0b\u6211\u4eec\u7684 transfer\u4ee3\u7801\u4e2d\u7684\u8fd9\u4e2a\u7ec6\u8282\uff1a\n<\/p>\n<pre class=\"brush:java;\">\r\ndo {\r\n    Entry&lt;K,V&gt; next = e.next; \/\/ &lt;--\u5047\u8bbe\u7ebf\u7a0b\u4e00\u6267\u884c\u5230\u8fd9\u91cc\u5c31\u88ab\u8c03\u5ea6\u6302\u8d77\u4e86\r\n    int i = indexFor(e.hash, newCapacity);\r\n    e.next = newTable[i];\r\n    newTable[i] = e;\r\n    e = next;\r\n}<\/pre>\n<p>\n\t\u800c\u6211\u4eec\u7684\u7ebf\u7a0b\u4e8c\u6267\u884c\u5b8c\u6210\u4e86\u3002\u4e8e\u662f\u6211\u4eec\u6709\u4e0b\u9762\u7684\u8fd9\u4e2a\u6837\u5b50\u3002\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"HashMap\" src=\"https:\/\/coolshell.cn\/wp-content\/uploads\/2013\/05\/HashMap02.jpg\" style=\"width: 616px;height: 434px\" \/>\n<\/p>\n<p>\n\t\u6ce8\u610f\uff0c<strong>\u56e0\u4e3aThread1\u7684 e \u6307\u5411\u4e86key(3)\uff0c\u800cnext\u6307\u5411\u4e86key(7)\uff0c\u5176\u5728\u7ebf\u7a0b\u4e8crehash\u540e\uff0c\u6307\u5411\u4e86\u7ebf\u7a0b\u4e8c\u91cd\u7ec4\u540e\u7684\u94fe\u8868<\/strong>\u3002\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u94fe\u8868\u7684\u987a\u5e8f\u88ab\u53cd\u8f6c\u540e\u3002\n<\/p>\n<p>\n\t<strong>2\uff09\u7ebf\u7a0b\u4e00\u88ab\u8c03\u5ea6\u56de\u6765\u6267\u884c\u3002<\/strong>\n<\/p>\n<ul>\n<li>\n\t\t<strong>\u5148\u662f\u6267\u884c newTalbe[i] = e;<\/strong>\n\t<\/li>\n<li>\n\t\t<strong>\u7136\u540e\u662fe = next\uff0c\u5bfc\u81f4\u4e86e\u6307\u5411\u4e86key(7)\uff0c<\/strong>\n\t<\/li>\n<li>\n\t\t<strong>\u800c\u4e0b\u4e00\u6b21\u5faa\u73af\u7684next = e.next\u5bfc\u81f4\u4e86next\u6307\u5411\u4e86key(3)<\/strong>\n\t<\/li>\n<\/ul>\n<p>\n\t<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"376\" src=\"https:\/\/coolshell.cn\/wp-content\/uploads\/2013\/05\/HashMap03.jpg\" width=\"591\" \/>\n<\/p>\n<p>\n\t<strong>3\uff09\u4e00\u5207\u5b89\u597d\u3002<\/strong>\n<\/p>\n<p>\n\t\u7ebf\u7a0b\u4e00\u63a5\u7740\u5de5\u4f5c\u3002<strong>\u628akey(7)\u6458\u4e0b\u6765\uff0c\u653e\u5230newTable[i]\u7684\u7b2c\u4e00\u4e2a\uff0c\u7136\u540e\u628ae\u548cnext\u5f80\u4e0b\u79fb<\/strong>\u3002\n<\/p>\n<p>\n\t<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"411\" src=\"https:\/\/coolshell.cn\/wp-content\/uploads\/2013\/05\/HashMap04.jpg\" width=\"627\" \/>\n<\/p>\n<p>\n\t<strong>4\uff09\u73af\u5f62\u94fe\u63a5\u51fa\u73b0\u3002<\/strong>\n<\/p>\n<p>\n\t<strong>e.next = newTable[i] \u5bfc\u81f4&nbsp; key(3).next \u6307\u5411\u4e86 key(7)<\/strong>\n<\/p>\n<p>\n\t<strong>\u6ce8\u610f\uff1a\u6b64\u65f6\u7684key(7).next \u5df2\u7ecf\u6307\u5411\u4e86key(3)\uff0c \u73af\u5f62\u94fe\u8868\u5c31\u8fd9\u6837\u51fa\u73b0\u4e86\u3002<\/strong>\n<\/p>\n<p>\n\t<img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"395\" src=\"https:\/\/coolshell.cn\/wp-content\/uploads\/2013\/05\/HashMap05.jpg\" width=\"623\" \/>\n<\/p>\n<p>\n\t<strong>\u4e8e\u662f\uff0c\u5f53\u6211\u4eec\u7684\u7ebf\u7a0b\u4e00\u8c03\u7528\u5230\uff0cHashTable.get(11)\u65f6\uff0c\u60b2\u5267\u5c31\u51fa\u73b0\u4e86&mdash;&mdash;Infinite Loop\u3002<\/strong>\n<\/p>\n<h2>\n\t\u5176\u5b83<br \/>\n<\/h2>\n<p>\n\t\u6709\u4eba\u628a\u8fd9\u4e2a\u95ee\u9898\u62a5\u7ed9\u4e86Sun\uff0c\u4e0d\u8fc7Sun\u4e0d\u8ba4\u4e3a\u8fd9\u4e2a\u662f\u4e00\u4e2a\u95ee\u9898\u3002\u56e0\u4e3aHashMap\u672c\u6765\u5c31\u4e0d\u652f\u6301\u5e76\u53d1\u3002\u8981\u5e76\u53d1\u5c31\u7528ConcurrentHashmap\n<\/p>\n<p>\n\t<a href=\"http:\/\/bugs.sun.com\/bugdatabase\/view_bug.do?bug_id=6423457\" target=\"_blank\">http:\/\/bugs.sun.com\/bugdatabase\/view_bug.do?bug_id=6423457<\/a>\n<\/p>\n<p>\n\t\u6211\u5728\u8fd9\u91cc\u628a\u8fd9\u4e2a\u4e8b\u60c5\u8bb0\u5f55\u4e0b\u6765\uff0c\u53ea\u662f\u4e3a\u4e86\u8ba9\u5927\u5bb6\u4e86\u89e3\u5e76\u4f53\u4f1a\u4e00\u4e0b\u5e76\u53d1\u73af\u5883\u4e0b\u7684\u5371\u9669\u3002\n<\/p>\n<p>\n\t\u53c2\u8003\u8d44\u6599\n<\/p>\n<ul>\n<li>\n\t\t<a href=\"http:\/\/mailinator.blogspot.com\/2009\/06\/beautiful-race-condition.html\" rel=\"nofollow\">http:\/\/mailinator.blogspot.com\/2009\/06\/beautiful-race-condition.html<\/a>\n\t<\/li>\n<\/ul>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=2872\">Java HashMap \u7684\u6b7b\u5faa\u73af(HashMap Infinite Loop)<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u5728\u6dd8\u5b9d\u5185\u7f51\u91cc\u770b\u5230\u540c\u4e8b\u53d1\u4e86\u8d34\u8bf4\u4e86\u4e00\u4e2aCPU\u88ab100%\u7684\u7ebf\u4e0a\u6545\u969c\uff0c\u5e76\u4e14\u8fd9\u4e2a\u4e8b\u53d1\u751f\u4e86\u5f88\u591a\u6b21\uff0c\u539f\u56e0\u662f\u5728Java\u8bed\u8a00\u5728\u5e76 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[1164,1161,1162,660,1163],"class_list":["post-2872","post","type-post","status-publish","format-standard","hentry","category-java","tag-concurrenthashmap","tag-hashmap","tag-hashtable","tag-hash","tag-linkedhashmap"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2872"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2872\/revisions"}],"predecessor-version":[{"id":2873,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2872\/revisions\/2873"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}