{"id":264601,"date":"2023-03-27T08:19:33","date_gmt":"2023-03-27T00:19:33","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=264601"},"modified":"2023-02-20T20:20:29","modified_gmt":"2023-02-20T12:20:29","slug":"meta-space-instead","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/meta-space-instead.html","title":{"rendered":"\u4e3a\u4ec0\u4e48\u7528\u5143\u7a7a\u95f4\u66ff\u4ee3\u6c38\u4e45\u4ee3\uff1f"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u6c38\u4e45\u4ee3\u548c\u5143\u7a7a\u95f4\u90fd\u662f HotSpot \u865a\u62df\u673a\u4e2d\u7684\u6982\u5ff5\uff0cHotSpot \u865a\u62df\u673a\u662f Sun JDK \u548c Open JDK \u4e2d\u81ea\u5e26\u7684\u865a\u62df\u673a\uff0c\u4e5f\u662f\u76ee\u524d\u4f7f\u7528\u8303\u56f4\u6700\u5e7f\u6cdb\u7684 Java \u865a\u62df\u673a\uff0c\u5f53\u6211\u4eec\u63d0\u5230\u865a\u62df\u673a\u65f6\uff0c\u5927\u6982\u7387\u6307\u7684\u5c31\u662f HotSpot \u865a\u62df\u673a\u3002\u90a3\u4e48\u95ee\u9898\u6765\u4e86\uff0c\u6c38\u4e45\u4ee3\u4e3a\u4ec0\u4e48\u88ab\u5143\u7a7a\u95f4\u7ed9\u66ff\u4ee3\u4e86\uff1f<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
1.\u5b98\u65b9\u7b54\u6848<\/strong><\/div>\n

\u5173\u4e8e\u8fd9\u4e2a\u95ee\u9898\uff0c\u5b98\u65b9\u5728 JEP 122: Remove the Permanent Generation\uff08\u79fb\u9664\u6c38\u4e45\u4ee3\uff09\u4e2d\u7ed9\u51fa\u4e86\u7b54\u6848\uff0c\u539f\u6587\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n

\nMotivation\uff08\u52a8\u673a\uff09
\nThis is part of the JRockit and Hotspot convergence effort. JRockit customers do not need to configure the permanent generation (since JRockit does not have a permanent generation) and are accustomed to not configuring the permanent generation.\n<\/p><\/blockquote>\n

\u4ee5\u4e0a\u5185\u5bb9\u7ffb\u8bd1\u6210\u4e2d\u6587\u5927\u610f\u662f\uff1a<\/p>\n

\n\u8fd9\u662f JRockit \u865a\u62df\u673a\u548c HotSpot \u865a\u62df\u673a\u878d\u5408\u5de5\u4f5c\u7684\u4e00\u90e8\u5206\u3002JRockit \u5ba2\u6237\u4e0d\u9700\u8981\u914d\u7f6e\u6c38\u4e45\u5c42\u4ee3\uff08\u56e0\u4e3a JRockit \u6ca1\u6709\u6c38\u4e45\u4ee3\uff09\uff0c\u6240\u4ee5\u8981\u79fb\u9664\u6c38\u4e45\u4ee3\u3002\n<\/p><\/blockquote>\n

JRockit \u662f Java \u5b98\u65b9\u6536\u8d2d\u7684\u4e00\u5bb6\u53f7\u79f0\u53f2\u4e0a\u8fd0\u884c\u6700\u5feb\u7684 Java \u865a\u62df\u673a\u5382\u5546\uff0c\u4e4b\u540e Java \u5b98\u65b9\u5728 JDK 8 \u65f6\u5c06 JRockit \u865a\u62df\u673a\u548c HotSpot \u865a\u62df\u673a\u8fdb\u884c\u4e86\u6574\u5408\u3002<\/p>\n

PS\uff1aJEP \u662f JDK Enhancement Proposal \u7684\u7f29\u5199\uff0c\u7ffb\u8bd1\u6210\u4e2d\u6587\u662f JDK \u6539\u8fdb\u63d0\u6848\u3002\u4f60\u4e5f\u53ef\u4ee5\u628a\u5b83\u7406\u89e3\u4e3a JDK \u7684\u66f4\u65b0\u6587\u6863\u3002
\n\u901a\u8fc7\u5b98\u65b9\u7684\u63cf\u8ff0\uff0c\u6211\u4eec\u4f3c\u4e4e\u627e\u5230\u4e86\u7b54\u6848\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u4e4b\u6240\u4ee5\u8981\u53d6\u6d88\u201c\u6c38\u4e45\u4ee3\u201d\u662f\u56e0\u4e3a Java \u5b98\u65b9\u6536\u8d2d\u4e86 JRockit\uff0c\u4e4b\u540e\u5728\u5c06 JRockit \u548c HotSpot \u8fdb\u884c\u6574\u5408\u65f6\uff0c\u56e0\u4e3a JRockit \u4e2d\u6ca1\u6709\u201c\u6c38\u4e45\u4ee3\u201d\uff0c\u6240\u4ee5\u628a\u6c38\u4e45\u4ee3\u7ed9\u79fb\u9664\u4e86\u3002<\/p>\n

PS\uff1a\u4e0a\u9762\u7684\u90a3\u6bb5\u63cf\u8ff0\u597d\u50cf\u8bf4\u7684\u5df2\u7ecf\u5f88\u6e05\u695a\u4e86\uff0c\u4f46\u53c8\u597d\u50cf\u4ec0\u4e48\u4e5f\u6ca1\u8bf4\u3002\u8fd9\u5c31\u597d\u6bd4\uff0c\u6211\u95ee\u4f60\u201c\u4e3a\u4ec0\u4e48\u8981\u4e70\u8f66\uff1f\u201d\uff0c\u4f60\u8bf4\u201c\u522b\u4eba\u90fd\u4e70\u8f66\u4e86\uff0c\u6240\u4ee5\u6211\u8981\u4e70\u8f66\u201d\uff0c\u4f46\u4e3a\u4ec0\u4e48\u522b\u4eba\u8981\u4e70\u8f66\uff1f<\/p>\n

2.\u80cc\u540e\u7684\u539f\u56e0<\/strong><\/div>\n

\u4e0a\u8ff0\u7ed9\u51fa\u4e86\u79fb\u9664\u6c38\u4e45\u4ee3\u7684\u56de\u7b54\uff0c\u4f46\u5374\u6ca1\u6709\u7ed9\u51fa\u80cc\u540e\u7684\u539f\u56e0\uff0c\u90a3\u63a5\u4e0b\u6765\u6211\u4eec\u5c31\u6765\u8ba8\u8bba\u4e00\u4e0b\uff0c\u4e3a\u4ec0\u4e48\u8981\u79fb\u9664\u6c38\u4e45\u4ee3\uff1f\u4ee5\u53ca\u4e3a\u4ec0\u4e48\u8981\u6709\u5143\u7a7a\u95f4\uff1f<\/p>\n

2.1 \u964d\u4f4e OOM<\/strong><\/span><\/div>\n

\u5f53\u4f7f\u7528\u6c38\u4e45\u4ee3\u5b9e\u73b0\u65b9\u6cd5\u533a\u65f6\uff0c\u6c38\u4e45\u4ee3\u7684\u6700\u5927\u5bb9\u91cf\u53d7\u5236\u4e8e PermSize \u548c MaxPermSize \u53c2\u6570\u8bbe\u7f6e\u7684\u5927\u5c0f\uff0c\u800c\u8fd9\u4e24\u4e2a\u53c2\u6570\u7684\u5927\u5c0f\u53c8\u5f88\u96be\u786e\u5b9a\uff0c\u56e0\u4e3a\u5728\u7a0b\u5e8f\u8fd0\u884c\u65f6\u9700\u8981\u52a0\u8f7d\u591a\u5c11\u7c7b\u662f\u5f88\u96be\u4f30\u7b97\u7684\uff0c\u5982\u679c\u8fd9\u4e24\u4e2a\u53c2\u6570\u8bbe\u7f6e\u7684\u8fc7\u5c0f\u5c31\u4f1a\u9891\u7e41\u7684\u89e6\u53d1 FullGC \u548c\u5bfc\u81f4 OOM\uff08Out of Memory\uff0c\u5185\u5b58\u6ea2\u51fa\uff09\u3002<\/p>\n

\u4f46\u662f\uff0c\u5f53\u4f7f\u7528\u5143\u7a7a\u95f4\u66ff\u4ee3\u4e86\u6c38\u4e45\u4ee3\u4e4b\u540e\uff0c\u51fa\u73b0 OOM \u7684\u51e0\u7387\u5c31\u88ab\u5927\u5927\u964d\u4f4e\u4e86\uff0c\u56e0\u4e3a\u5143\u7a7a\u95f4\u4f7f\u7528\u7684\u662f\u672c\u5730\u5185\u5b58\uff0c\u8fd9\u6837\u5143\u7a7a\u95f4\u7684\u5927\u5c0f\u5c31\u53ea\u548c\u672c\u5730\u5185\u5b58\u7684\u5927\u5c0f\u6709\u5173\u4e86\uff0c\u4ece\u800c\u5927\u5927\u964d\u4f4e\u4e86 OOM \u7684\u95ee\u9898\u3002<\/p>\n

2.2 \u964d\u4f4e\u8fd0\u7ef4\u6210\u672c<\/strong><\/span><\/div>\n

\u56e0\u4e3a\u5143\u7a7a\u95f4\u4f7f\u7528\u7684\u662f\u672c\u5730\u5185\u5b58\uff0c\u8fd9\u6837\u5c31\u65e0\u9700\u8fd0\u7ef4\u4eba\u5458\u518d\u53bb\u4e13\u95e8\u8bbe\u7f6e\u548c\u8c03\u6574\u5143\u7a7a\u95f4\u7684\u5927\u5c0f\u4e86\u3002<\/p>\n

3.\u65b9\u6cd5\u533a\u53d1\u5c55\u53f2<\/strong><\/div>\n

\u5728 HotSpot \u865a\u62df\u673a\u4e2d\uff0c\u65b9\u6cd5\u533a\u7684\u5b9e\u73b0\u7ecf\u5386\u4e86\u4ee5\u4e0b 3 \u4e2a\u9636\u6bb5\uff1a<\/p>\n

JDK 1.6 \u53ca\u4e4b\u524d\uff1a\u65b9\u6cd5\u533a\u4f7f\u7528\u6c38\u4e45\u4ee3\u5b9e\u73b0\uff0c\u9759\u6001\u53d8\u91cf\u5b58\u653e\u5728\u6c38\u4e45\u4ee3\uff1b
\nJDK 1.7 \uff1a\u201c\u53bb\u6c38\u4e45\u4ee3\u201d\u7684\u524d\u7f6e\u7248\u672c\uff0c\u8fd8\u5b58\u5728\u6c38\u4e45\u4ee3\uff0c\u4e0d\u8fc7\u5df2\u7ecf\u5c06\u5b57\u7b26\u4e32\u5e38\u91cf\u6c60\u548c\u9759\u6001\u53d8\u91cf\u4ece\u6c38\u4e45\u4ee3\u79fb\u5230\u4e86\u5806\u4e0a\uff1b
\nJDK 1.8 \u53ca\u4ee5\u540e\uff1a\u65e0\u6c38\u4e45\u4ee3\uff0c\u4f7f\u7528\u5143\u7a7a\u95f4\uff08\u5b58\u653e\u5728\u672c\u5730\u5185\u5b58\u4e2d\uff09\u5b9e\u73b0\u65b9\u6cd5\u533a\uff0c\u5e38\u91cf\u4fdd\u5b58\u5728\u5143\u7a7a\u95f4\uff0c\u4f46\u5b57\u7b26\u4e32\u5e38\u91cf\u6c60\u548c\u9759\u6001\u53d8\u91cf\u4f9d\u7136\u4fdd\u5b58\u5728\u5806\u4e2d\u3002<\/p>\n

\u603b\u7ed3<\/strong><\/div>\n

\u6c38\u4e45\u4ee3\u548c\u5143\u7a7a\u95f4\u90fd\u662f HotSpot \u865a\u62df\u673a\u5bf9\u300aJava \u865a\u62df\u673a\u89c4\u8303\u300b\u4e2d\u65b9\u6cd5\u533a\u7684\u5b9e\u73b0\uff0c\u5728 JDK 1.8 \u4e4b\u524d HotSpot \u662f\u4f7f\u7528\u6c38\u4e45\u4ee3\u6765\u5b9e\u73b0\u65b9\u6cd5\u533a\u7684\uff0c\u4f46\u8fd9\u6837\u4f1a\u5bfc\u81f4 JVM \u8c03\u4f18\u6bd4\u8f83\u56f0\u96be\uff0c\u4e14\u5bb9\u6613\u53d1\u751f OOM \u7684\u95ee\u9898\uff0c\u800c JDK 1.8 \u53ca\u4e4b\u540e\uff0c\u4f7f\u7528\u7684\u662f\u5143\u7a7a\u95f4\u5b58\u653e\u5728\u672c\u5730\u5185\u5b58\u4e2d\u7684\u65b9\u5f0f\u6765\u66ff\u4ee3\u6c38\u4e45\u4ee3\u7684\uff0c\u8fd9\u6837\u5c31\u964d\u4f4e\u4e86 OOM \u53d1\u751f\u7684\u53ef\u80fd\u6027\uff0c\u4e5f\u662f JRockit \u548c HotSpot \u878d\u5408\u4e4b\u540e\u7684\u6539\u52a8\u4e4b\u4e00\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5173\u4e8e\u8fd9\u4e2a\u95ee\u9898\uff0c\u5b98\u65b9\u5728 JEP 122: Remove the Permanent Generation\uff08\u79fb\u9664\u6c38 […]<\/p>\n","protected":false},"author":1903,"featured_media":264604,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-264601","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/264601","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1903"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=264601"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/264601\/revisions"}],"predecessor-version":[{"id":264603,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/264601\/revisions\/264603"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/264604"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=264601"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=264601"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=264601"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}