{"id":10697,"date":"2023-11-28T21:41:46","date_gmt":"2023-11-28T13:41:46","guid":{"rendered":"https:\/\/wx.kaifamiao.info\/?p=10697"},"modified":"2023-12-07T14:44:48","modified_gmt":"2023-12-07T06:44:48","slug":"jvm-zhong-wei-shen-me-yao-jiang-yong-jiu-dai-permg","status":"publish","type":"post","link":"http:\/\/wx.kaifamiao.info\/index.php\/2023\/11\/28\/jvm-zhong-wei-shen-me-yao-jiang-yong-jiu-dai-permg\/","title":{"rendered":"JVM\u4e2d\u4e3a\u4ec0\u4e48\u8981\u5c06\u6c38\u4e45\u4ee3(PermGen)\u66ff\u6362\u4e3a\u5143\u7a7a\u95f4(MetaSpace) \u5462\uff1f"},"content":{"rendered":"<p>Java 7\u53ca\u4e4b\u524d\u7684\u7248\u672c\u4e2d\uff0c\u6c38\u4e45\u4ee3\uff08Permanent Generation\uff0cPermGen\uff09\u7528\u4e8e\u5b58\u653e\u7c7b\u7684\u5143\u6570\u636e\u4fe1\u606f\uff0c\u5982\u7c7b\u540d\u3001\u5b57\u6bb5\u3001\u65b9\u6cd5\u7b49\u3002\u7136\u800c\uff0c\u6c38\u4e45\u4ee3\u5b58\u5728\u4e00\u4e9b\u95ee\u9898\uff0c\u5bfc\u81f4\u5728 Java 8 \u4e2d\u88ab\u5143\u7a7a\u95f4\uff08Metaspace\uff09\u6240\u53d6\u4ee3\u3002\u4ee5\u4e0b\u662f\u66ff\u6362\u7684\u539f\u56e0\uff1a<\/p>\n<ol>\n<li>\n<strong>\u56fa\u5b9a\u5927\u5c0f\u7684\u6c38\u4e45\u4ee3\uff1a<\/strong> \u6c38\u4e45\u4ee3\u5728 Java \u865a\u62df\u673a\u542f\u52a8\u65f6\u5c31\u9700\u8981\u5206\u914d\u56fa\u5b9a\u5927\u5c0f\u7684\u5185\u5b58\u3002\u8fd9\u6837\u7684\u8bbe\u8ba1\u5bfc\u81f4\u4e86\u4e00\u4e9b\u95ee\u9898\uff0c\u4f8b\u5982\u5f88\u96be\u9884\u4f30\u5e94\u7528\u7a0b\u5e8f\u771f\u5b9e\u9700\u8981\u7684\u6c38\u4e45\u4ee3\u5927\u5c0f\uff0c\u53ef\u80fd\u5bfc\u81f4\u5185\u5b58\u6ea2\u51fa\u6216\u6d6a\u8d39\u3002\n<\/li>\n<li>\n<strong>\u6c38\u4e45\u4ee3\u5783\u573e\u56de\u6536\u95ee\u9898\uff1a<\/strong> \u6c38\u4e45\u4ee3\u4e2d\u7684\u5783\u573e\u56de\u6536\u5e76\u4e0d\u50cf\u65b0\u751f\u4ee3\u548c\u8001\u5e74\u4ee3\u90a3\u6837\u9ad8\u6548\uff0c\u7279\u522b\u662f Full GC \u9700\u8981\u505c\u6b62\u5e94\u7528\u7a0b\u5e8f\u7ebf\u7a0b\uff0c\u53ef\u80fd\u5bfc\u81f4\u957f\u65f6\u95f4\u7684\u505c\u987f\u3002\n<\/li>\n<li>\n<strong>OOM \u9519\u8bef\uff1a<\/strong> \u7531\u4e8e\u6c38\u4e45\u4ee3\u7684\u5927\u5c0f\u662f\u56fa\u5b9a\u7684\uff0c\u5f53\u52a0\u8f7d\u7684\u7c7b\u6216\u5143\u6570\u636e\u8d85\u8fc7\u4e86\u6c38\u4e45\u4ee3\u7684\u5bb9\u91cf\u65f6\uff0c\u5c31\u5bb9\u6613\u5bfc\u81f4 OutOfMemoryError \u9519\u8bef\u3002\n<\/li>\n<li>\n<strong>\u7c7b\u5378\u8f7d\u7684\u95ee\u9898\uff1a<\/strong> \u6c38\u4e45\u4ee3\u4e2d\u7684\u7c7b\u5378\u8f7d\u76f8\u5bf9\u56f0\u96be\uff0c\u5bb9\u6613\u51fa\u73b0\u7c7b\u52a0\u8f7d\u5668\u6cc4\u6f0f\uff0c\u5bfc\u81f4\u6c38\u4e45\u4ee3\u5185\u5b58\u6cc4\u6f0f\u3002\n<\/li>\n<\/ol>\n<p>\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\uff0cJava 8 \u5f15\u5165\u4e86\u5143\u7a7a\u95f4\uff08Metaspace\uff09\u3002\u5143\u7a7a\u95f4\u7684\u7279\u70b9\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>\n<strong>\u52a8\u6001\u5206\u914d\u5185\u5b58\uff1a<\/strong> \u5143\u7a7a\u95f4\u4e0d\u518d\u6709\u56fa\u5b9a\u7684\u5185\u5b58\u5927\u5c0f\uff0c\u800c\u662f\u4f7f\u7528\u672c\u5730\u5185\u5b58\uff08native memory\uff09\uff0c\u5145\u5206\u5229\u7528\u7cfb\u7edf\u8d44\u6e90\u3002\n<\/li>\n<li>\n<strong>\u5783\u573e\u56de\u6536\uff1a<\/strong> \u5143\u7a7a\u95f4\u4f7f\u7528\u5783\u573e\u56de\u6536\u6765\u91ca\u653e\u4e0d\u518d\u4f7f\u7528\u7684\u7c7b\u548c\u5143\u6570\u636e\u3002\u4e0e\u6c38\u4e45\u4ee3\u4e0d\u540c\uff0c\u5143\u7a7a\u95f4\u4e2d\u7684\u5783\u573e\u56de\u6536\u662f\u5e76\u53d1\u7684\uff0c\u51e0\u4e4e\u4e0d\u4f1a\u5bfc\u81f4\u505c\u987f\u3002\n<\/li>\n<li>\n<strong>\u81ea\u52a8\u8c03\u6574\u5927\u5c0f\uff1a<\/strong> \u5143\u7a7a\u95f4\u53ef\u4ee5\u6839\u636e\u9700\u8981\u81ea\u52a8\u8c03\u6574\u5927\u5c0f\uff0c\u800c\u4e0d\u518d\u53d7\u5230\u6c38\u4e45\u4ee3\u7684\u56fa\u5b9a\u9650\u5236\u3002\n<\/li>\n<li>\n<strong>\u7c7b\u5378\u8f7d\uff1a<\/strong> \u5728\u5143\u7a7a\u95f4\u4e2d\uff0c\u7531\u4e8e\u5783\u573e\u56de\u6536\u7684\u652f\u6301\uff0c\u7c7b\u7684\u5378\u8f7d\u66f4\u52a0\u5bb9\u6613\u5b9e\u73b0\uff0c\u907f\u514d\u4e86\u7c7b\u52a0\u8f7d\u5668\u6cc4\u6f0f\u95ee\u9898\u3002\n<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u8fd9\u4e9b\u6539\u8fdb\uff0c\u5143\u7a7a\u95f4\u663e\u8457\u63d0\u9ad8\u4e86 Java \u5e94\u7528\u7a0b\u5e8f\u7684\u7a33\u5b9a\u6027\u548c\u6027\u80fd\u3002\u5b83\u4f7f\u5f97 Java \u865a\u62df\u673a\u66f4\u52a0\u7075\u6d3b\uff0c\u5e76\u66f4\u597d\u5730\u9002\u5e94\u4e0d\u540c\u7c7b\u578b\u7684\u5e94\u7528\u7a0b\u5e8f\u5de5\u4f5c\u8d1f\u8f7d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Java 7\u53ca\u4e4b\u524d\u7684\u7248\u672c\u4e2d\uff0c\u6c38\u4e45\u4ee3\uff08Permanent Generation\uff0cPermGen\uff09\u7528\u4e8e\u5b58\u653e\u7c7b\u7684\u5143\u6570 [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[119],"tags":[],"class_list":["post-10697","post","type-post","status-publish","format-standard","hentry","category-jvm"],"_links":{"self":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/10697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/comments?post=10697"}],"version-history":[{"count":2,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/10697\/revisions"}],"predecessor-version":[{"id":16881,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/10697\/revisions\/16881"}],"wp:attachment":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/media?parent=10697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/categories?post=10697"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/tags?post=10697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}