{"id":2864,"date":"2018-06-16T16:51:36","date_gmt":"2018-06-16T08:51:36","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=2864"},"modified":"2018-06-16T16:51:36","modified_gmt":"2018-06-16T08:51:36","slug":"%e5%b8%b8%e8%a7%81%e7%9a%84%e4%b8%89%e7%a7%8d%e5%86%85%e5%ad%98%e6%ba%a2%e5%87%ba%e5%bc%82%e5%b8%b8%e6%80%bb%e7%bb%93%ef%bc%88outofmemoryerror%ef%bc%9a-java-heap-space%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=2864","title":{"rendered":"\u5e38\u89c1\u7684\u4e09\u79cd\u5185\u5b58\u6ea2\u51fa\u5f02\u5e38\u603b\u7ed3\uff08OutOfMemoryError\uff1a Java heap space\uff09"},"content":{"rendered":"<p>\n\t\u81ea\u4ece jdk \u88ab\u5b89\u88c5\u540e\uff0c\u6211\u4eec\u5f88\u5c11\u53bb\u67e5\u770b\u5b83\u3002\u4f46\u662f\u5f53\u7a0b\u5e8f\u4e00\u51fa\u73b0\u5185\u5b58\u6ea2\u51fa\u7684\u65f6\u5019\uff0c\u5c31\u5fc5\u987b\u8981\u6709\u5bf9 JVM \u975e\u5e38\u719f\u6089\u7684\u4e86\u89e3\u3002\u672c\u6587\u603b\u7ed3\u4e86\u4e09\u79cd\u5185\u5b58\u6ea2\u51fa\u5f02\u5e38\uff0c\u5206\u522b\u662f\uff1aOutOfMemoryError\uff1a Java heap space &nbsp;\u5806\u6ea2\u51fa\uff1bOutOfMemoryError\uff1a PermGen space &nbsp; \u975e\u5806\u6ea2\u51fa\uff08\u6c38\u4e45\u4fdd\u5b58\u533a\u57df\u6ea2\u51fa\uff09\uff1bOutOfMemoryError\uff1a unable to create new native thread. &nbsp; \u65e0\u6cd5\u521b\u5efa\u65b0\u7684\u7ebf\u7a0b\u3002\u4e0b\u9762\u5206\u522b\u8bf4\u8bf4\u8fd9\u4e09\u79cd\u5e38\u89c1\u7684\u5f02\u5e38\u53ef\u80fd\u4ea7\u751f\u7684\u539f\u56e0\u3002\n<\/p>\n<ul>\n<li>\n<p>\n\t\t\tOutOfMemoryError\uff1a Java heap space &nbsp;\u5806\u6ea2\u51fa\n\t\t<\/p>\n<p>\n\t\t\t\u5185\u5b58\u6ea2\u51fa\u4e3b\u8981\u5b58\u5728\u95ee\u9898\u5c31\u662f\u51fa\u73b0\u5728\u8fd9\u4e2a\u60c5\u51b5\u4e2d\u3002\u5f53\u5728JVM\u4e2d\u5982\u679c98\uff05\u7684\u65f6\u95f4\u662f\u7528\u4e8eGC\u4e14\u53ef\u7528\u7684 Heap size \u4e0d\u8db32\uff05\u7684\u65f6\u5019\u5c06\u629b\u51fa\u6b64\u5f02\u5e38\u4fe1\u606f\u3002\n\t\t<\/p>\n<\/li>\n<li>\n<p>\n\t\t\tOutOfMemoryError\uff1a PermGen space &nbsp; \u975e\u5806\u6ea2\u51fa\uff08\u6c38\u4e45\u4fdd\u5b58\u533a\u57df\u6ea2\u51fa\uff09\n\t\t<\/p>\n<p>\n\t\t\t\u8fd9\u79cd\u9519\u8bef\u5e38\u89c1\u5728web\u670d\u52a1\u5668\u5bf9JSP\u8fdb\u884cpre compile\u7684\u65f6\u5019\u3002\u5982\u679c\u4f60\u7684WEB APP\u4e0b\u90fd\u7528\u4e86\u5927\u91cf\u7684\u7b2c\u4e09\u65b9jar, \u5176\u5927\u5c0f\u8d85\u8fc7\u4e86jvm\u9ed8\u8ba4\u7684\u5927\u5c0f(4M)\u90a3\u4e48\u5c31\u4f1a\u4ea7\u751f\u6b64\u9519\u8bef\u4fe1\u606f\u4e86\u3002\u5982\u679cweb app\u7528\u4e86\u5927\u91cf\u7684\u7b2c\u4e09\u65b9jar\u6216\u8005\u5e94\u7528\u6709\u592a\u591a\u7684class\u6587\u4ef6\u800c\u6070\u597dMaxPermSize\u8bbe\u7f6e\u8f83\u5c0f\uff0c\u8d85\u51fa\u4e86\u4e5f\u4f1a\u5bfc\u81f4\u8fd9\u5757\u5185\u5b58\u7684\u5360\u7528\u8fc7\u591a\u9020\u6210\u6ea2\u51fa\uff0c\u6216\u8005tomcat\u70ed\u90e8\u7f72\u65f6\u4faf\u4e0d\u4f1a\u6e05\u7406\u524d\u9762\u52a0\u8f7d\u7684\u73af\u5883\uff0c\u53ea\u4f1a\u5c06context\u66f4\u6539\u4e3a\u65b0\u90e8\u7f72\u7684\uff0c\u975e\u5806\u5b58\u7684\u5185\u5bb9\u5c31\u4f1a\u8d8a\u6765\u8d8a\u591a\u3002\n\t\t<\/p>\n<\/li>\n<li>\n<p>\n\t\t\tOutOfMemoryError\uff1a unable to create new native thread. &nbsp; \u65e0\u6cd5\u521b\u5efa\u65b0\u7684\u7ebf\u7a0b\n\t\t<\/p>\n<p>\n\t\t\t\u8fd9\u79cd\u73b0\u8c61\u6bd4\u8f83\u5c11\u89c1\uff0c\u4e5f\u6bd4\u8f83\u5947\u602a\uff0c\u4e3b\u8981\u662f\u548cjvm\u4e0e\u7cfb\u7edf\u5185\u5b58\u7684\u6bd4\u4f8b\u6709\u5173\u3002\u8fd9\u79cd\u602a\u4e8b\u662f\u56e0\u4e3aJVM\u5df2\u7ecf\u88ab\u7cfb\u7edf\u5206\u914d\u4e86\u5927\u91cf\u7684\u5185\u5b58\uff08\u6bd4\u59821.5G\uff09\uff0c\u5e76\u4e14\u5b83\u81f3\u5c11\u8981\u5360\u7528\u53ef\u7528\u5185\u5b58\u7684\u4e00\u534a\u3002\n\t\t<\/p>\n<\/li>\n<\/ul>\n<p>\n\t\u4e0a\u9762 3 \u4e2d\u662f\u6700\u5e38\u89c1\u548c\u6700\u4e3b\u8981\u7684 Java \u5185\u5b58\u6ea2\u51fa\uff0c\u9762\u8bd5\u4e2d\u7ecf\u5e38\u88ab\u95ee\uff0c\u5b9e\u9645\u5de5\u4f5c\u4e2d\u7ecf\u5e38\u5907\u7528\u7684\u77e5\u8bc6\u70b9\u3002\u5e0c\u671b\u5927\u5bb6\u7262\u8bb0\uff01<\/p>\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=2864\">\u5e38\u89c1\u7684\u4e09\u79cd\u5185\u5b58\u6ea2\u51fa\u5f02\u5e38\u603b\u7ed3\uff08OutOfMemoryError\uff1a Java heap space\uff09<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u81ea\u4ece jdk \u88ab\u5b89\u88c5\u540e\uff0c\u6211\u4eec\u5f88\u5c11\u53bb\u67e5\u770b\u5b83\u3002\u4f46\u662f\u5f53\u7a0b\u5e8f\u4e00\u51fa\u73b0\u5185\u5b58\u6ea2\u51fa\u7684\u65f6\u5019\uff0c\u5c31\u5fc5\u987b\u8981\u6709\u5bf9 JVM \u975e\u5e38\u719f\u6089\u7684\u4e86\u89e3 [&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":[328,261,1647,601,263],"class_list":["post-2864","post","type-post","status-publish","format-standard","hentry","category-java","tag-gc","tag-java","tag-jvm","tag-outofmemoryerror","tag-substring"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2864","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=2864"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2864\/revisions"}],"predecessor-version":[{"id":2865,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2864\/revisions\/2865"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}