{"id":4759,"date":"2024-05-22T08:37:44","date_gmt":"2024-05-22T00:37:44","guid":{"rendered":"https:\/\/xinchewhd.com.cn\/index.php\/%e9%9d%a2%e8%af%95\/%e7%be%8e%e5%9b%a2%e4%b8%80%e9%9d%a2%ef%bc%9a%e7%a2%b0%e5%88%b0%e8%bf%87oom%e5%90%97%ef%bc%9f%e4%bd%a0%e6%98%af%e6%80%8e%e4%b9%88%e5%a4%84%e7%90%86%e7%9a%84%ef%bc%9f\/"},"modified":"2024-08-02T17:03:16","modified_gmt":"2024-08-02T09:03:16","slug":"%e7%be%8e%e5%9b%a2%e4%b8%80%e9%9d%a2%ef%bc%9a%e7%a2%b0%e5%88%b0%e8%bf%87oom%e5%90%97%ef%bc%9f%e4%bd%a0%e6%98%af%e6%80%8e%e4%b9%88%e5%a4%84%e7%90%86%e7%9a%84%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/xinchewhd.com.cn\/index.php\/%e9%9d%a2%e8%af%95\/%e7%be%8e%e5%9b%a2%e4%b8%80%e9%9d%a2%ef%bc%9a%e7%a2%b0%e5%88%b0%e8%bf%87oom%e5%90%97%ef%bc%9f%e4%bd%a0%e6%98%af%e6%80%8e%e4%b9%88%e5%a4%84%e7%90%86%e7%9a%84%ef%bc%9f\/","title":{"rendered":"\u7f8e\u56e2\u4e00\u9762\uff1a\u78b0\u5230\u8fc7OOM\u5417\uff1f\u4f60\u662f\u600e\u4e48\u5904\u7406\u7684\uff1f"},"content":{"rendered":"<div class=\"wxsyncmain\">\n<section style=\"margin-bottom: 0px; padding-left: 10px; padding-right: 10px; background-attachment: scroll; background-clip: border-box; background-image: linear-gradient(90deg, rgba(50, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0) 6.76%), linear-gradient(360deg, rgba(50, 0, 0, 0.05) 0%, rgba(249, 247, 252, 0) 9.46%); background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat, repeat; background-size: 20px 20px, 20px 20px; width: auto; font-family: Optima, 'Microsoft YaHei', PingFangSC-regular, serif; font-size: 16px; color: #000000; line-height: 1.5em; word-spacing: 0em; letter-spacing: 0em; word-break: break-word; text-align: left;\" data-tool=\"mdnice\u7f16\u8f91\u5668\" data-website=\"https:\/\/www.mdnice.com\">\n<p style=\"color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u54c8\u55bd\uff0c\u5927\u5bb6\u597d\uff0c\u6211\u662f\u660e\u667a<\/p>\n<p style=\"color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u63a5\u4e0b\u6765\u7684\u51e0\u7bc7\u6587\u7ae0\u6211\u4f1a\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u4e00\u7cfb\u5217\u9762\u8bd5\u9898\uff0c\u8fd9\u4e9b\u9762\u8bd5\u9898\u6709\u4e9b\u662f\u6211\u9762\u8bd5\u7684\u65f6\u5019\u522b\u4eba\u95ee\u6211\u7684\uff0c\u6709\u4e9b\u662f\u6211\u81ea\u5df1\u4f5c\u4e3a\u9762\u8bd5\u5b98\u65f6\u53bb\u95ee\u522b\u4eba\u7684\uff0c\u6709\u4e9b\u662f\u4e00\u4e9b\u5c0f\u4f19\u4f34\u5728\u9762\u8bd5\u540e\u8ddf\u6211\u4e00\u8d77\u8ba8\u8bba\u8fc7\u7684\uff0c\u6211\u4f1a\u628a\u8fd9\u4e9b\u9898\u76ee\u6574\u7406\u6210\u6587\u7ae0\uff0c\u6162\u6162\u548c\u5927\u5bb6\u5206\u4eab\u3002<\/p>\n<p style=\"color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5982\u679c\u9762\u8bd5\u88ab\u63d0\u5230\u4e86OOM\u76f8\u5173\u7684\u95ee\u9898\uff0c\u90a3\u4e48\u9762\u8bd5\u5b98\u4e3b\u8981\u5728\u610f\u7684\u6709\u54ea\u4e9b\u5462\uff1f<\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\"><strong style=\"color: #916dd5; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\">\u4f60\u6709\u6ca1\u6709\u5b9e\u9645\u5904\u7406OOM\u7684\u7ecf\u9a8c<\/strong>\u3002<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u8fd9\u662f\u56e0\u4e3a\u5982\u679c\u6709\u8fd9\u65b9\u9762\u7684\u7ecf\u9a8c\uff0c\u90a3\u4e48\u4f60\u5728\u5b9e\u9645\u5de5\u4f5c\u4e2d\u4f1a\u81ea\u89c9\u89c4\u907f\u8fd9\u7c7b\u95ee\u9898\uff0c\u5199\u51fa\u66f4\u9ad8\u8d28\u91cf\u7684\u4ee3\u7801<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\"><strong style=\"color: #916dd5; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\">\u8003\u5bdf\u4e00\u4e2a\u4eba\u662f\u5426\u6709\u89e3\u51b3\u67d0\u7c7b\u95ee\u9898\u7684\u7ecf\u9a8c\u7684\u4e00\u4e2a\u5f88\u91cd\u8981\u89d2\u5ea6\u5c31\u662f\u4ed6\u662f\u5426\u80fd\u51c6\u786e\u63cf\u8ff0\u51fa\u53d1\u751f\u8fd9\u7c7b\u95ee\u9898\u540e\u7684\u73b0\u8c61<\/strong>\uff0c\u4f60\u53ef\u80fd\u4f1a\u5fd8\u8bb0\u4f60\u662f\u5982\u4f55\u5904\u7406\u8fd9\u4e2a\u95ee\u9898\u7684\uff0c\u4f46\u662f\u4f60\u4e00\u5b9a\u5fd8\u4e0d\u4e86\u90a3\u4e2a\u88ab\u544a\u8b66\u7535\u8bdd\u8f70\u70b8\u7684\u90a3\u4e2a\u665a\u4e0a\u3002<\/p>\n<p style=\"line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u8fd9\u4e5f\u662f\u4e0a\u7bc7\u6587\u7ae0\u300a<a style=\"color: #916dd5; font-weight: bold; border-style: none none solid; border-width: 1px; border-color: #1e6bb8 #1e6bb8 #916dd5; border-radius: 0px;\" href=\"https:\/\/mp.weixin.qq.com\/s?__biz=MzU5ODg2Njk4OA==&amp;mid=2247485406&amp;idx=1&amp;sn=a3ee849d527743a7790f368dcc7c9efe&amp;scene=21#wechat_redirect\" data-linktype=\"2\" target=\"_blank\"  rel=\"nofollow\" >\u7f8e\u56e2\u4e00\u9762\uff0c\u53d1\u751fOOM\u4e86\uff0c\u7a0b\u5e8f\u8fd8\u80fd\u7ee7\u7eed\u8fd0\u884c\u5417\uff1f<\/a>\u300b\u60f3\u8981\u5e2e\u5927\u5bb6\u89e3\u51b3\u7684\u95ee\u9898<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\"><strong style=\"color: #916dd5; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\">\u8003\u5bdf\u4f60\u5bf9OOM\u8fd9\u65b9\u9762\u7684\u77e5\u8bc6\u70b9\u4e86\u89e3\u7684\u600e\u4e48\u6837\uff0c\u4fd7\u79f0\uff1a\u516b\u80a1\u53d6\u58eb<\/strong>\u3002<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 8px; object-fit: fill; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px; height: auto !important;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240528154217688.jpeg\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-imgfileid=\"100001762\" data-ratio=\"1.3769633507853403\" data-type=\"jpeg\" data-w=\"191\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 8px; object-fit: fill; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px; height: auto !important;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240528154217688.jpeg\" data-imgfileid=\"100001762\" data-ratio=\"1.3769633507853403\" data-type=\"jpeg\" data-w=\"191\" \/><\/noscript><\/figure>\n<p style=\"line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u5f53\u7136\uff0c\u516b\u80a1\u5e76\u4e0d\u662f\u4e00\u65e0\u662f\u5904\uff0c\u54b1\u4eec\u4e5f\u5fc5\u987b\u627f\u8ba4\u5f88\u591a\u5de5\u4f5c\u4e2d\u78b0\u5230\u7684\u95ee\u9898\u7684\u7b54\u6848\u5c31\u85cf\u5728\u8fd9\u4e9b\u516b\u80a1\u91cc\u9762\u3002\u4eca\u5929\u5c31\u60f3\u901a\u8fc7\u8fd9\u7bc7\u516b\u80a1\u6587\u8ddf\u5927\u5bb6\u804a\u804aOOM\u3002\u54b1\u4eec\u5148\u8bf4\u8bf4OOM\u6709\u54ea\u51e0\u79cd\uff0c\u518d\u8bb2\u8bb2\u5728\u78b0\u5230OOM\u540e\u5982\u4f55\u5feb\u901f\u5b9a\u4f4d\uff0c\u6700\u540e\u804a\u4e00\u804a\u5b9a\u4f4d\u4e86OOM\u5982\u4f55\u4fee\u590d\uff0c\u9001\u4e00\u5957\u7ec4\u5408\u62f3\u7ed9\u5927\u5bb6\uff0c\u4e0d\u7528\u8c22\uff01<\/p>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;\"><img decoding=\"async\" class=\"rich_pages wxw-img lazyload\" style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 8px; object-fit: fill; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px; height: auto !important;\" data-src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240528154219409.gif\" src=\"https:\/\/s.nmxc.ltd\/sakurairo_vision\/@2.6\/load_svg\/inload.svg\" onerror=\"imgError(this)\" data-imgfileid=\"100001761\" data-ratio=\"1\" data-type=\"gif\" data-w=\"120\" \/><noscript><img decoding=\"async\" class=\"rich_pages wxw-img\" style=\"display: block; margin-right: auto; margin-left: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 8px; object-fit: fill; box-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px; height: auto !important;\" src=\"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240528154219409.gif\" data-imgfileid=\"100001761\" data-ratio=\"1\" data-type=\"gif\" data-w=\"120\" \/><\/noscript><\/figure>\n<\/section>\n<\/li>\n<\/ol>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; border-radius: 0px; box-shadow: none; flex-direction: unset; float: unset; height: auto; justify-content: unset; line-height: 1.5em; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset; border: 1px none #000000;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; color: #595959; line-height: 1.8em; letter-spacing: 0em; padding-left: 10px; border-style: none none none solid; border-width: 1px 1px 1px 5px; border-color: #000000 #000000 #000000 #dec6fb; border-radius: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; box-shadow: none; display: block; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\">\u4e00\u3001OOM\u7684\u5206\u7c7b<\/span><\/h2>\n<h3 style=\"margin-top: 30px; margin-bottom: 15px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; border-radius: 0px; box-shadow: none; display: flex; flex-direction: unset; float: unset; height: auto; justify-content: center; line-height: 1.5em; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset; border: 1px none #000000;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 17px; color: #595959; border-color: #000000 #000000 #dec6fb; line-height: 1.5em; letter-spacing: 0em; align-items: unset; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; border-style: none none solid; border-width: 1px 1px 2px; border-radius: 0px; box-shadow: none; display: inline; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\">1. Java Heap Space OOM<\/span><\/h3>\n<p style=\"color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8fd9\u662f\u6700\u5e38\u89c1\u7684OOM\u7c7b\u578b\u4e4b\u4e00\u3002\u5806\u5185\u5b58\u4e0d\u8db3\u65f6\uff0cJVM\u4f1a\u629b\u51fa\u8fd9\u4e2a\u9519\u8bef\u3002<\/p>\n<p style=\"color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong style=\"color: #916dd5; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\">\u73b0\u8c61<\/strong>\uff1a\u5e94\u7528\u7a0b\u5e8f\u5360\u7528\u7684\u5806\u5185\u5b58\u8d85\u51fa\u4e86\u6700\u5927\u9650\u5236\uff0c\u5bfc\u81f4\u65e0\u6cd5\u518d\u5206\u914d\u5185\u5b58\u3002<\/p>\n<p style=\"color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong style=\"color: #916dd5; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\">\u793a\u4f8b\u4ee3\u7801<\/strong>\uff1a<\/p>\n<p>import\u00a0java.util.ArrayList;<br \/>\nimport\u00a0java.util.List;<\/p>\n<p>\/\/\u00a0\u4e3a\u4e86\u65b9\u4fbf\u590d\u73b0\uff0c\u5efa\u8bae\u8c03\u6574jvm\u53c2\u6570\uff1a-Xmx100m<br \/>\npublic\u00a0class\u00a0HeapOOM\u00a0{<br \/>\nstatic\u00a0class\u00a0OOMObject\u00a0{<br \/>\n\/\/\u00a0\u5360\u7528\u4e00\u5b9a\u5185\u5b58\u7684\u5bf9\u8c61<br \/>\nprivate\u00a0byte[]\u00a0memory\u00a0=\u00a0new\u00a0byte[1024\u00a0*\u00a01024];\u00a0\/\/\u00a01MB<br \/>\n}<\/p>\n<p>public\u00a0static\u00a0void\u00a0main(String[]\u00a0args)\u00a0{<br \/>\nList&lt;OOMObject&gt;\u00a0list\u00a0=\u00a0new\u00a0ArrayList&lt;&gt;();<br \/>\nwhile\u00a0(true)\u00a0{<br \/>\nlist.add(new\u00a0OOMObject());<br \/>\n}<br \/>\n}<br \/>\n}<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8fd0\u884c\u8fd9\u6bb5\u4ee3\u7801\uff0c\u5f88\u5feb\u4f60\u5c31\u4f1a\u770b\u5230<code>java.lang.OutOfMemoryError: Java heap space<\/code>\u7684\u63d0\u793a\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u54b1\u4eec\u5728\u5e73\u5e38\u5f00\u53d1\u7684\u8fc7\u7a0b\u4e2d\uff0c\u5982\u679c\u51fa\u73b0\u4e86OOM\uff0c99.99%\u7684\u539f\u56e0\u90fd\u662f\u56e0\u4e3a<code>Java Heap Space OOM<\/code>\uff0c\u5373\uff1a\u5806\u5185\u5b58\u6ea2\u51fa\u3002\u5982\u679c\u4f60\u78b0\u5230\u8fc7\u975e\u5806\u5185\u5b58\u7684\u6ea2\u51fa\u8bf7\u544a\u8bc9\u6211\uff0c\u6211\u613f\u610f\u628a\u8fd9\u4e2a\u6982\u7387\u8c03\u6574\u4e3a99.98%<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">2. GC Overhead Limit Exceeded<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5783\u573e\u56de\u6536\u673a\u5236\u4e5f\u4f1a\u5bfc\u81f4OOM\u54e6\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u539f\u56e0<\/strong>\uff1a\u8fd9\u4e2a\u662fJDK6\u65b0\u52a0\u7684\u9519\u8bef\u7c7b\u578b\uff0c\u4e00\u822c\u90fd\u662f\u5806\u592a\u5c0f\u5bfc\u81f4\u7684\u3002Sun \u5b98\u65b9\u5bf9\u6b64\u7684\u5b9a\u4e49\uff1a\u8d85\u8fc798%\u7684\u65f6\u95f4\u7528\u6765\u505aGC\u5e76\u4e14\u56de\u6536\u4e86\u4e0d\u52302%\u7684\u5806\u5185\u5b58\u65f6\u4f1a\u629b\u51fa\u6b64\u5f02\u5e38\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u89e3\u51b3\u65b9\u6cd5<\/strong><\/p>\n<ol class=\"list-paddingleft-1\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section>\u68c0\u67e5\u9879\u76ee\u4e2d\u662f\u5426\u6709\u5927\u91cf\u7684\u6b7b\u5faa\u73af\u6216\u6709\u4f7f\u7528\u5927\u5185\u5b58\u7684\u4ee3\u7801\uff0c\u4f18\u5316\u4ee3\u7801\u3002<\/section>\n<\/li>\n<li>\n<section>\u6dfb\u52a0\u53c2\u6570\u00a0<code>-XX:-UseGCOverheadLimit<\/code>\u00a0\u7981\u7528\u8fd9\u4e2a\u68c0\u67e5\uff0c\u5176\u5b9e\u8fd9\u4e2a\u53c2\u6570\u89e3\u51b3\u4e0d\u4e86\u5185\u5b58\u95ee\u9898\uff0c\u53ea\u662f\u628a\u9519\u8bef\u7684\u4fe1\u606f\u5ef6\u540e\uff0c\u6700\u7ec8\u51fa\u73b0 java.lang.OutOfMemoryError: Java heap space\u3002<\/section>\n<\/li>\n<li>\n<section>dump\u5185\u5b58\uff0c\u68c0\u67e5\u662f\u5426\u5b58\u5728\u5185\u5b58\u6cc4\u9732\uff0c\u5982\u679c\u6ca1\u6709\uff0c\u52a0\u5927\u5185\u5b58\u3002<\/section>\n<\/li>\n<\/ol>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u793a\u4f8b\u4ee3\u7801<\/strong>\uff1a<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">import\u00a0java.util.HashMap;<br \/>\nimport\u00a0java.util.Map;<br \/>\n\/\/\u00a0\u4e3a\u4e86\u65b9\u4fbf\u590d\u73b0\uff0c\u5efa\u8bae\u8c03\u6574jvm\u53c2\u6570\uff1a-Xmx100m<br \/>\npublic\u00a0class\u00a0GCOverheadOOM\u00a0{<br \/>\npublic\u00a0static\u00a0void\u00a0main(String[]\u00a0args)\u00a0{<br \/>\nMap&lt;Integer,\u00a0String&gt;\u00a0map\u00a0=\u00a0new\u00a0HashMap&lt;&gt;();<br \/>\nfor\u00a0(int\u00a0i\u00a0=\u00a00;\u00a0;\u00a0i++)\u00a0{<br \/>\nmap.put(i,\u00a0new\u00a0String(new\u00a0char[10]));<br \/>\n}<br \/>\n}<br \/>\n}<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8fd9\u6bb5\u4ee3\u7801\u4f1a\u5bfc\u81f4\u9891\u7e41\u7684\u5783\u573e\u56de\u6536\uff0c\u6700\u7ec8\u629b\u51fa<code>java.lang.OutOfMemoryError: GC overhead limit exceeded<\/code>\u9519\u8bef\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5b9e\u9645\u5de5\u4f5c\u4e2d\uff0c\u57fa\u672c\u4e0d\u4f1a\u78b0\u5230\u8fd9\u4e2a\u5f02\u5e38<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">3. PermGen Space OOM<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6c38\u4e45\u4ee3\uff08\u6216\u5143\u7a7a\u95f4\uff09\u5185\u5b58\u4e0d\u8db3\u65f6\uff0c\u4f1a\u629b\u51fa\u8fd9\u4e2a\u9519\u8bef\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u73b0\u8c61<\/strong>\uff1a\u6c38\u4e45\u4ee3\u5185\u5b58\u4e0d\u8db3\uff0c\u5bfc\u81f4\u52a0\u8f7d\u7c7b\u4fe1\u606f\u5931\u8d25\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u793a\u4f8b\u4ee3\u7801<\/strong>\uff1a<\/p>\n<p>import\u00a0java.lang.reflect.Proxy;<br \/>\nimport\u00a0java.util.ArrayList;<br \/>\nimport\u00a0java.util.List;<\/p>\n<p>public\u00a0class\u00a0PermGenOOM\u00a0{<br \/>\npublic\u00a0static\u00a0void\u00a0main(String[]\u00a0args)\u00a0{<br \/>\nList&lt;Class&lt;?&gt;&gt;\u00a0classes\u00a0=\u00a0new\u00a0ArrayList&lt;&gt;();<\/p>\n<p>\/\/\u00a0\u65e0\u9650\u5faa\u73af\uff0c\u6301\u7eed\u751f\u6210\u7c7b<br \/>\nfor\u00a0(int\u00a0i\u00a0=\u00a00;\u00a0;\u00a0i++)\u00a0{<br \/>\ntry\u00a0{<br \/>\n\/\/\u00a0\u4f7f\u7528\u52a8\u6001\u4ee3\u7406\u751f\u6210\u65b0\u7684\u7c7b<br \/>\nClass&lt;?&gt;\u00a0proxyClass\u00a0=\u00a0Proxy.getProxyClass(<br \/>\nPermGenOOM.class.getClassLoader(),<br \/>\nMyInterface.class<br \/>\n);<br \/>\nclasses.add(proxyClass);<br \/>\nSystem.out.println(\"Generated\u00a0class:\u00a0\"\u00a0+\u00a0proxyClass.getName());<br \/>\n}\u00a0catch\u00a0(Exception\u00a0e)\u00a0{<br \/>\ne.printStackTrace();<br \/>\nbreak;<br \/>\n}<br \/>\n}<br \/>\n}<\/p>\n<p>\/\/\u00a0\u4e00\u4e2a\u7b80\u5355\u7684\u63a5\u53e3\uff0c\u7528\u6765\u751f\u6210\u4ee3\u7406\u7c7b<br \/>\ninterface\u00a0MyInterface\u00a0{<br \/>\nvoid\u00a0myMethod();<br \/>\n}<br \/>\n}<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8fd9\u6bb5\u4ee3\u7801\u901a\u8fc7\u4e0d\u65ad\u751f\u6210\u65b0\u7684\u4ee3\u7406\u7c7b\uff0c\u5e76\u5c06\u5176\u6dfb\u52a0\u5230\u5217\u8868\u4e2d\uff0c\u6a21\u62df\u4e86\u6c38\u4e45\u4ee3\u5185\u5b58\u7684\u6d88\u8017\uff0c\u6700\u7ec8\u4f1a\u5bfc\u81f4<code>java.lang.OutOfMemoryError: PermGen space<\/code>\u9519\u8bef\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u5982\u679c\u4f60\u5728\u9879\u76ee\u6709\u6709\u52a8\u6001\u53bb\u751f\u6210\u7c7b\uff0c\u90a3\u4e48\u4f60\u9700\u8981\u8003\u8651\u5230\u662f\u5426\u4f1a\u521b\u5efa\u592a\u591a\u7684\u7c7b\u800c\u5bfc\u81f4\u5143\u7a7a\u95f4\u5185\u5b58\u6ea2\u51fa\uff0c\u4e00\u822c\u60c5\u51b5\u4e0b\u4e0d\u9700\u8981\u8003\u8651<\/strong><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">4. Direct Buffer Memory OOM<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u76f4\u63a5\u5185\u5b58\u4e0d\u8db3\uff0cNIO\u64cd\u4f5c\u5931\u8d25\u65f6\u4f1a\u629b\u51fa\u8fd9\u4e2a\u9519\u8bef\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u73b0\u8c61<\/strong>\uff1a\u76f4\u63a5\u5185\u5b58\u4e0d\u8db3\uff0c\u5bfc\u81f4NIO\u64cd\u4f5c\u5931\u8d25\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u793a\u4f8b\u4ee3\u7801<\/strong>\uff1a<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">import\u00a0java.nio.ByteBuffer;<\/p>\n<p>public\u00a0class\u00a0DirectBufferOOM\u00a0{<br \/>\npublic\u00a0static\u00a0void\u00a0main(String[]\u00a0args)\u00a0{<br \/>\nwhile\u00a0(true)\u00a0{<br \/>\nByteBuffer.allocateDirect(1024\u00a0*\u00a01024);<br \/>\n}<br \/>\n}<br \/>\n}<\/p>\n<p>\u8fd0\u884c\u8fd9\u6bb5\u4ee3\u7801\uff0c\u6700\u7ec8\u4f1a\u629b\u51fa<code>java.lang.OutOfMemoryError: Direct buffer memory<\/code>\u3002<\/p>\n<p>\u4e8c\u3001\u5982\u4f55\u5b9a\u4f4dOOM\u7684\u539f\u56e0<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\">1.1 \u5de5\u5177<\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8981\u89e3\u51b3OOM\u95ee\u9898\uff0c\u9996\u5148\u5f97\u77e5\u9053\u95ee\u9898\u51fa\u5728\u54ea\u91cc\uff0c\u54b1\u4eec\u5148\u4ecb\u7ecd\u51e0\u4e2a\u5de5\u5177<\/p>\n<ul class=\"list-paddingleft-1\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section><strong>JVisualVM<\/strong>\uff1a\u8fd9\u662fJDK\u81ea\u5e26\u7684\u76d1\u63a7\u5de5\u5177\uff0c\u53ef\u4ee5\u5b9e\u65f6\u67e5\u770b\u5e94\u7528\u7684\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3001\u7ebf\u7a0b\u6d3b\u52a8\u548c\u5806\u5feb\u7167\u7b49\u3002<\/section>\n<\/li>\n<li>\n<section><strong>JProfiler<\/strong>\uff1a\u8fd9\u662f\u4e00\u4e2a\u5f3a\u5927\u7684Java\u6027\u80fd\u5206\u6790\u5de5\u5177\uff0c\u80fd\u591f\u8be6\u7ec6\u5206\u6790\u5185\u5b58\u4f7f\u7528\u3001\u7ebf\u7a0b\u3001GC\u7b49\u60c5\u51b5\uff0c\u9002\u5408\u8fdb\u884c\u6df1\u5ea6\u5206\u6790\u3002<\/section>\n<\/li>\n<li>\n<section><strong>Eclipse MAT\uff08Memory Analyzer Tool\uff09<\/strong>\uff1a\u8fd9\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u5806\u8f6c\u50a8\u5206\u6790\u5de5\u5177\uff0c\u80fd\u591f\u5e2e\u52a9\u8bc6\u522b\u5185\u5b58\u6cc4\u6f0f\u548c\u5927\u5bf9\u8c61\u3002<\/section>\n<\/li>\n<\/ul>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\">1.2 \u64cd\u4f5c\u6b65\u9aa4<\/h3>\n<ol class=\"list-paddingleft-1\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section><strong>\u751f\u6210\u5806\u8f6c\u50a8\u6587\u4ef6<\/strong>\uff1a\u5f53\u51fa\u73b0OOM\u65f6\uff0c\u53ef\u4ee5\u751f\u6210\u5806\u8f6c\u50a8\u6587\u4ef6\u4f9b\u5206\u6790\u4f7f\u7528\u3002<\/p>\n<p>\u901a\u5e38\u6765\u8bf4\uff0c\u6211\u4eec\u90fd\u4f1a\u914d\u7f6ejvm\u53c2\u6570\uff0c\u5f53\u53d1\u751fOOM\u540e\u81ea\u52a8\u751f\u6210dump\u6587\u4ef6\uff0c\u53c2\u6570\u5982\u4e0b:<\/p>\n<p>#\u00a0\u8bbe\u7f6e\u5f53\u9996\u6b21\u906d\u9047\u5185\u5b58\u6ea2\u51fa\u65f6\u5bfc\u51fa\u6b64\u65f6\u5806\u4e2d\u76f8\u5173\u4fe1\u606f<br \/>\n-XX:+HeapDumpOnOutOfMemoryError<br \/>\n#\u00a0\u6307\u5b9a\u5bfc\u51fa\u5806\u4fe1\u606f\u65f6\u7684\u8def\u5f84\u6216\u6587\u4ef6\u540d<br \/>\n-XX:HeapDumpPath=\/tmp\/heapdump.hprof<\/p>\n<p>\u5f53\u7136\uff0c\u6709\u65f6\u5019\u53ef\u80fd\u4f60\u5fd8\u8bb0\u914d\u7f6e\u4e86\u8fd9\u4e9b\u53c2\u6570\uff0c\u90a3\u4e48\u4f60\u53ef\u4ee5\u901a\u8fc7\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<p>jmap\u00a0-dump:live,format=b,file=heapdump.hprof\u00a01234<br \/>\n#\u00a01234\u4ee3\u8868java\u7a0b\u5e8f\u7684pid\uff0c\u53ef\u4ee5\u901a\u8fc7jps\u8fd9\u4e2a\u547d\u4ee4\u83b7\u53d6\u5230<\/p>\n<ol class=\"list-paddingleft-1\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section>\u4e0d\u8fc7\u5927\u90e8\u5206\u60c5\u51b5\u5f53\u4f60\u53bb\u6267\u884cjmap\u547d\u4ee4\u65f6\uff0c\u7a0b\u5e8f\u5df2\u7ecf\u5d29\u6e83\u4e86\u3002\u8fd9\u79cd\u60c5\u51b5\u6211\u4eec\u5e94\u8be5\u600e\u4e48\u529e\u5462\uff1f<\/p>\n<p>\u4e00\u822c\u6765\u8bf4\u5982\u679c\u95ee\u9898\u53d1\u751f\u7684\u73b0\u573a\u6ca1\u6709\u8f83\u597d\u88ab\u4fdd\u5b58\u7684\u8bdd\uff0c\u65e2\u6ca1\u6709\u65e5\u5fd7\uff0c\u4e5f\u6ca1\u6709\u5806dump\u6587\u4ef6\uff0c\u8fd9\u4e2a\u65f6\u5019\u6700\u597d\u7684\u529e\u6cd5\u5c31\u662f\u52a0\u4e00\u4e9b\u76d1\u63a7\u3002<\/p>\n<p>\u9996\u5148\uff0c\u4f60\u5e94\u8be5\u5c06JVM\u914d\u7f6e\u4e0a\uff0c\u4fdd\u8bc1\u4e0b\u6b21\u51fa\u73b0OOM\u65f6\u80fd\u591f\u5b8c\u6574\u7684\u4fdd\u7559dump\u6587\u4ef6\uff0c\u5176\u6b21\u5982\u679c\u516c\u53f8\u6ca1\u6709\u5b8c\u5584\u7684\u76d1\u63a7\u5e73\u53f0\u7684\u8bdd\uff0c\u90a3\u4e48\u4f60\u53ef\u4ee5\u901a\u8fc7\u4e00\u4e9bshell\u811a\u672c\uff0c\u5b9a\u65f6\u7684\u5c06\u5806dump\u6587\u4ef6\u4fdd\u5b58\u4e0b\u6765\uff0c\u4ee5\u4fbf\u89c2\u5bdf\u5185\u5b58\u7684\u53d8\u52a8\u60c5\u51b5\uff0c\u4e00\u822c\u8fd9\u4e2a\u4e8b\u60c5\u90fd\u662f\u8ba9\u516c\u53f8\u7684\u8fd0\u7ef4\u53bb\u505a\uff0c\u6211\u4eec\u53ea\u9700\u8981\u53bb\u5206\u6790dump\u6587\u4ef6\u5c31\u884c\u4e86<\/p>\n<\/section>\n<\/li>\n<li>\n<section><strong>\u5206\u6790\u5806dump\u6587\u4ef6<\/strong>\uff1a\u4f7f\u7528Eclipse MAT\u6216JVisualVM\u6253\u5f00\u5806\u8f6c\u50a8\u6587\u4ef6\uff0c\u67e5\u770b\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\uff0c\u627e\u51fa\u5360\u7528\u5185\u5b58\u6700\u591a\u7684\u5bf9\u8c61\u3002<\/p>\n<p>\u751f\u6210\u5806\u8f6c\u50a8\u6587\u4ef6\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528Eclipse MAT\u6216JVisualVM\u8fdb\u884c\u5206\u6790\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528Eclipse MAT\u7684\u5177\u4f53\u6b65\u9aa4\uff1a<\/p>\n<\/section>\n<ol class=\"list-paddingleft-1\">\n<li>\n<section><strong>\u542f\u52a8Eclipse MAT<\/strong><\/section>\n<\/li>\n<li>\n<section><strong>\u52a0\u8f7d\u5806\u8f6c\u50a8\u6587\u4ef6<\/strong>\uff1a\u5728Eclipse MAT\u4e2d\uff0c\u9009\u62e9\u201cFile\u201d &gt; \u201cOpen Heap Dump\u201d\u6253\u5f00\u751f\u6210\u7684<code>heapdump.hprof<\/code>\u6587\u4ef6\u3002<\/section>\n<\/li>\n<li>\n<section><strong>\u5206\u6790\u5185\u5b58\u4f7f\u7528\u60c5\u51b5<\/strong>\uff1aEclipse MAT\u4f1a\u81ea\u52a8\u5206\u6790\u5806\u8f6c\u50a8\u6587\u4ef6\uff0c\u5e76\u751f\u6210\u4e00\u4efd\u5185\u5b58\u4f7f\u7528\u62a5\u544a\u3002\u53ef\u4ee5\u67e5\u770b\u201cHistogram\u201d\u89c6\u56fe\uff0c\u627e\u5230\u5360\u7528\u5185\u5b58\u6700\u591a\u7684\u5bf9\u8c61\u3002<\/section>\n<\/li>\n<\/ol>\n<\/li>\n<li>\n<section><strong>\u67e5\u770bGC\u65e5\u5fd7<\/strong>\uff1a\u901a\u8fc7\u5206\u6790GC\u65e5\u5fd7\uff0c\u53ef\u4ee5\u4e86\u89e3\u5783\u573e\u56de\u6536\u7684\u9891\u7387\u548c\u5185\u5b58\u5206\u914d\u60c5\u51b5\u3002\u542f\u52a8\u5e94\u7528\u65f6\uff0c\u6dfb\u52a0\u5982\u4e0b\u53c2\u6570\u4ee5\u542f\u7528GC\u65e5\u5fd7\uff1a<\/p>\n<p>java\u00a0-Xloggc:gc.log\u00a0-XX:+PrintGCDetails\u00a0-XX:+PrintGCDateStamps\u00a0-XX:+PrintGCCause\u00a0MyApplication<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4e09\u3001\u89e3\u51b3OOM\u7684\u65b9\u6848<\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5b9e\u9645\u4e0aOOM\u6700\u96be\u7684\u662f\u5b9a\u4f4d\uff0c\u53ea\u8981\u95ee\u9898\u5b9a\u4f4d\u5230\u4e86\uff0c\u89e3\u51b3\u8d77\u6765\u90fd\u4e0d\u9ebb\u70e6\u3002OOM\u8bf4\u767d\u4e86\u5c31\u662f\u5185\u5b58\u4e0d\u591f\u7528\u4e86\uff0c\u4e0d\u591f\u7528\u7684\u539f\u56e0\u53ef\u80fd\u662f<\/p>\n<ol class=\"list-paddingleft-1\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section>\u6d6a\u8d39\u592a\u591a\u4e86\uff0c\u4e5f\u5c31\u662f\u5185\u5b58\u6ea2\u51fa<\/section>\n<\/li>\n<li>\n<section>\u7528\u7684\u65b9\u5f0f\u4e0d\u5bf9\uff0c\u4e00\u6b21\u7533\u8bf7\u592a\u591a\u4e86\uff0c\u4e5f\u5c31\u662f\u521b\u5efa\u4e86\u4e00\u4e9b\u5927\u5bf9\u8c61<\/section>\n<\/li>\n<li>\n<section>\u5185\u5b58\u771f\u4e0d\u591f\u7528\u4e86\uff0c\u8981\u52a0\u914d\u7f6e\u4e86<\/section>\n<\/li>\n<li>\n<section>\u4e0d\u60f3\u52a0\u914d\u7f6e\u548b\u529e\uff1f\u60f3\u529e\u6cd5\u8c03\u8c03GC\uff0c\u627e\u627e\u66f4\u9ad8\u6548\u7684\u56de\u6536\u7b97\u6cd5<\/section>\n<\/li>\n<\/ol>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u867d\u7136\u6211\u4e0b\u9762\u8fd8\u505a\u4e86\u4e00\u4e9b\u5206\u7c7b\uff0c\u4f46\u662f\u6838\u5fc3\u601d\u8def\u5c31\u662f\u8fd94\u70b9<\/p>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\">1.\u5806\u5185\u5b58\u6ea2\u51fa<\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">Java Heap Space OOM\u8ddfGC Overhead Limit Exceeded\u90fd\u5f52\u7c7b\u5230\u5806\u5185\u5b58\u6ea2\u51fa<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u89e3\u51b3\u65b9\u6848<\/strong>\uff1a<\/p>\n<ul class=\"list-paddingleft-1\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section><strong>\u4f18\u5316\u4ee3\u7801<\/strong>\uff1a<\/p>\n<\/section>\n<ul class=\"list-paddingleft-1\">\n<li>\n<section><strong>\u51cf\u5c11\u5185\u5b58\u5360\u7528<\/strong>\uff1a\u5c3d\u91cf\u51cf\u5c11\u5927\u5bf9\u8c61\u7684\u4f7f\u7528\uff0c\u5408\u7406\u89c4\u5212\u5bf9\u8c61\u7684\u751f\u547d\u5468\u671f\u3002<\/section>\n<\/li>\n<li>\n<section><strong>\u907f\u514d\u5185\u5b58\u6cc4\u6f0f<\/strong>\uff1a\u786e\u4fdd\u4e0d\u518d\u4f7f\u7528\u7684\u5bf9\u8c61\u80fd\u88ab\u53ca\u65f6\u56de\u6536\uff0c\u4f8b\u5982\u5173\u95ed\u4e0d\u518d\u4f7f\u7528\u7684\u8fde\u63a5\u3001\u91ca\u653e\u8d44\u6e90\u7b49\u3002<\/section>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<section><strong>\u8c03\u6574JVM\u53c2\u6570<\/strong>\uff1a<\/p>\n<p>java\u00a0-Xmx1024m\u00a0MyApplication<\/p>\n<ul class=\"list-paddingleft-1\">\n<li>\n<section><strong>Serial GC<\/strong>\uff1a\u9002\u5408\u5355\u7ebf\u7a0b\u73af\u5883\uff0c\u6682\u505c\u65f6\u95f4\u8f83\u957f\uff0c\u4f46\u5b9e\u73b0\u7b80\u5355\u3002<\/section>\n<\/li>\n<li>\n<section><strong>Parallel GC<\/strong>\uff1a\u9002\u5408\u591a\u7ebf\u7a0b\u73af\u5883\uff0c\u541e\u5410\u91cf\u9ad8\uff0c\u6682\u505c\u65f6\u95f4\u8f83\u77ed\u3002<\/section>\n<\/li>\n<li>\n<section><strong>CMS GC<\/strong>\uff1a\u5e76\u53d1\u6807\u8bb0-\u6e05\u9664\u7b97\u6cd5\uff0c\u9002\u5408\u4f4e\u5ef6\u8fdf\u5e94\u7528\uff0c\u4f46\u4f1a\u4ea7\u751f\u788e\u7247\u3002<\/section>\n<\/li>\n<li>\n<section><strong>G1 GC<\/strong>\uff1a\u5783\u573e\u4f18\u5148\u6536\u96c6\u5668\uff0c\u9002\u5408\u5927\u5185\u5b58\u4f4e\u5ef6\u8fdf\u5e94\u7528\uff0c\u80fd\u591f\u5747\u8861\u6682\u505c\u65f6\u95f4\u548c\u541e\u5410\u91cf\u3002<\/section>\n<\/li>\n<li>\n<section>\u8c03\u6574GC\u7b56\u7565\uff1a\u6839\u636e\u5e94\u7528\u9700\u6c42\u9009\u62e9\u5408\u9002\u7684\u5783\u573e\u56de\u6536\u7b56\u7565\u3002<\/p>\n<p>java\u00a0-XX:+UseSerialGC\u00a0MyApplication<\/p>\n<p>java\u00a0-XX:+UseParallelGC\u00a0MyApplication<\/p>\n<p>java\u00a0-XX:+UseConcMarkSweepGC\u00a0MyApplication<\/p>\n<p>java\u00a0-XX:+UseG1GC\u00a0MyApplication<\/p>\n<ul class=\"list-paddingleft-1\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li style=\"list-style-type: none;\">\n<ul class=\"list-paddingleft-1\">\n<li>\n<section>\u589e\u52a0\u5806\u5185\u5b58\uff1a\u9002\u5f53\u589e\u52a0\u5806\u5185\u5b58\u5927\u5c0f\uff0c\u4f8b\u5982\u901a\u8fc7<code>-Xmx<\/code>\u53c2\u6570\u6765\u8c03\u6574\u6700\u5927\u5806\u5185\u5b58\u3002<\/section>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\">2. \u6c38\u4e45\u4ee3\u3001\u5143\u7a7a\u95f4\u6ea2\u51fa<\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u89e3\u51b3\u65b9\u6848<\/strong>\uff1a<\/p>\n<ul class=\"list-paddingleft-1\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section><strong>\u51cf\u5c11\u7c7b\u52a0\u8f7d<\/strong>\uff1a\u5c3d\u91cf\u51cf\u5c11\u52a8\u6001\u751f\u6210\u7c7b\u548c\u4f7f\u7528\u53cd\u5c04\u7684\u6b21\u6570\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section>\u8c03\u6574\u6c38\u4e45\u4ee3\u6216\u5143\u7a7a\u95f4\u5927\u5c0f<\/p>\n<p>java\u00a0-XX:MaxMetaspaceSize=256m\u00a0MyApplication<\/p>\n<ul class=\"list-paddingleft-1\">\n<li>\n<section>\u5bf9\u4e8e\u8001\u7248\u672c\u7684Java\uff0c\u53ef\u4ee5\u901a\u8fc7<code>-XX:MaxPermSize<\/code>\u53c2\u6570\u6765\u8c03\u6574\u6c38\u4e45\u4ee3\u5927\u5c0f\u3002\u5bf9\u4e8eJava 8\u53ca\u4ee5\u4e0a\u7248\u672c\uff0c\u4f7f\u7528<code>-XX:MaxMetaspaceSize<\/code>\u53c2\u6570\u8c03\u6574\u5143\u7a7a\u95f4\u5927\u5c0f\u3002<\/section>\n<\/li>\n<\/ul>\n<h3 data-tool=\"mdnice\u7f16\u8f91\u5668\">3.\u76f4\u63a5\u5185\u5b58\u6ea2\u51fa<\/h3>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u89e3\u51b3\u65b9\u6848<\/strong>\uff1a<\/p>\n<ul class=\"list-paddingleft-1\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section><strong>\u51cf\u5c11\u76f4\u63a5\u5185\u5b58\u5206\u914d<\/strong>\uff1a\u5c3d\u91cf\u51cf\u5c11\u5927\u5757\u76f4\u63a5\u5185\u5b58\u7684\u5206\u914d\uff0c\u4f7f\u7528\u5806\u5185\u5b58\u4ee3\u66ff\u3002<\/p>\n<\/section>\n<\/li>\n<li>\n<section>\u8c03\u6574\u76f4\u63a5\u5185\u5b58\u5927\u5c0f\uff1a\u901a\u8fc7<\/p>\n<p>-XX:MaxDirectMemorySize<\/p>\n<\/section>\n<\/li>\n<\/ul>\n<\/section>\n<\/li>\n<\/ul>\n<\/section>\n<\/li>\n<\/ul>\n<\/section>\n<\/li>\n<\/ul>\n<\/section>\n<\/li>\n<\/ol>\n<\/section>\n<\/li>\n<\/ol>\n<pre style=\"border-radius: 5px; box-shadow: rgba(0, 0, 0, 0.55) 0px 2px 10px; margin-top: 10px; margin-bottom: 10px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><code style=\"overflow-x: auto; color: #abb2bf; width: auto; margin-left: 2px; margin-right: 2px; padding: 15px 4px 2px; border-style: none; border-width: 3px; border-color: #000000 rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); word-break: break-all; background: #282c34; display: -webkit-box; font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; border-radius: 0px; font-size: 12px;\">java-XX:MaxDirectMemorySize=256mMyApplication<\/code><\/pre>\n<\/section>\n<h2 style=\"margin-top: 30px; margin-bottom: 15px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; border-radius: 0px; box-shadow: none; flex-direction: unset; float: unset; height: auto; justify-content: unset; line-height: 1.5em; overflow: unset; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset; border: 1px none #000000;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><span style=\"font-size: 18px; color: #595959; line-height: 1.8em; letter-spacing: 0em; padding-left: 10px; border-style: none none none solid; border-width: 1px 1px 1px 5px; border-color: #000000 #000000 #000000 #dec6fb; border-radius: 0px; align-items: unset; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; box-shadow: none; display: block; font-weight: bold; flex-direction: unset; float: unset; height: auto; justify-content: unset; overflow: unset; text-indent: 0em; text-shadow: none; transform: none; width: auto; -webkit-box-reflect: unset;\">\u56db\u3001\u603b\u7ed3<\/span><\/h2>\n<p style=\"color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u76f8\u4fe1\u770b\u5b8c\u8fd9\u4e24\u7bc7\u6587\u7ae0\uff0c\u5927\u5bb6\u5bf9OOM\u7684\u95ee\u9898\u5df2\u7ecf\u6709\u4e86\u6df1\u5165\u4e86\u89e3\u3002\u5728\u9762\u8bd5\u7684\u65f6\u5019\uff0c\u5982\u679c\u78b0\u5230\u8fd9\u7c7b\u95ee\u9898\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u6211\u4eec\u9996\u5148\u8981\u5411\u9762\u8bd5\u5b98\u8bc1\u660e\uff1a<strong style=\"color: #916dd5; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\">\u6211\u66fe\u7ecf\u78b0\u5230\u8fc7OOM<\/strong>\u3002<\/p>\n<p style=\"color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u63cf\u8ff0\u53d1\u751fOOM\u540e\u7a0b\u5e8f\u7684\u4e00\u4e9b\u8868\u73b0\uff0c\u4ee5\u53ca\u9879\u76ee\u4e2d\u53d1\u751fOOM\u7684\u539f\u56e0\u6765\u5c55\u793a\u6211\u4eec\u7684\u7ecf\u9a8c\u3002\u6bd4\u5982\uff0c\u6211\u5728\u300a<a style=\"color: #916dd5; font-weight: bold; border-style: none none solid; border-width: 1px; border-color: #1e6bb8 #1e6bb8 #916dd5; border-radius: 0px;\" href=\"https:\/\/mp.weixin.qq.com\/s?__biz=MzU5ODg2Njk4OA==&amp;mid=2247485406&amp;idx=1&amp;sn=a3ee849d527743a7790f368dcc7c9efe&amp;scene=21#wechat_redirect\" data-linktype=\"2\" target=\"_blank\"  rel=\"nofollow\" >\u7f8e\u56e2\u4e00\u9762\uff0c\u53d1\u751fOOM\u4e86\uff0c\u7a0b\u5e8f\u8fd8\u80fd\u7ee7\u7eed\u8fd0\u884c\u5417\uff1f<\/a>\u300b\u8fd9\u7bc7\u6587\u7ae0\u4e2d\u63d0\u5230\u7684\u771f\u5b9e\u7ecf\u5386\uff1a\u4e0a\u7ebf\u521d\u671f\uff0c\u6570\u636e\u91cf\u5f88\u5c11\uff0c\u6211\u4eec\u4e00\u6b21\u6027\u67e5\u8be2\u4e86\u6240\u6709\u6570\u636e\u3002\u968f\u7740\u4e1a\u52a1\u7684\u589e\u957f\uff0c\u67e5\u8be2\u7684\u6570\u636e\u91cf\u53d8\u5f97\u8fc7\u591a\uff0c\u5bfc\u81f4\u4e86OOM\u3002<\/p>\n<p style=\"color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5f53\u53d1\u751fOOM\u65f6\uff0c\u6211\u63a5\u5230\u4e86\u544a\u8b66\u7535\u8bdd\u3002\u67e5\u770b\u76d1\u63a7\u548c\u4ee3\u7801\u540e\uff0c\u5f88\u5feb\u786e\u8ba4\u662f\u6570\u636e\u91cf\u8fc7\u5927\u5bfc\u81f4\u7684OOM\u3002\u867d\u7136\u51fa\u73b0\u4e86OOM\u544a\u8b66\uff0c\u4f46\u4e5f\u6ca1\u6709\u7acb\u523b\u4fee\u590d\u3002\u4e00\u65b9\u9762\uff0c\u56e0\u4e3a\u65f6\u95f4\u5f88\u665a\uff1b\u53e6\u4e00\u65b9\u9762\uff0c\u56e0\u4e3a\u8dd1\u6279\u7684\u7ebf\u7a0b\u6302\u6389\u540e\uff0c\u7a0b\u5e8f\u7684\u5185\u5b58\u4f7f\u7528\u7387\u5c31\u964d\u4e0b\u6765\u4e86\u3002\u6240\u4ee5\u5f53\u65f6\u53ea\u662f\u6682\u65f6\u5173\u95ed\u4e86\u8dd1\u6279\u4efb\u52a1\uff0c\u7b2c\u4e8c\u5929\u5230\u516c\u53f8\u624d\u8fdb\u884c\u5904\u7406\u3002<\/p>\n<p style=\"color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8fd9\u6837\u7684\u771f\u5b9e\u7ecf\u5386\u5f80\u5f80\u66f4\u80fd\u8bf4\u670d\u9762\u8bd5\u5b98\uff0c\u9762\u8bd5\u8003\u5bdf\u7684\u4e0d\u4ec5\u4ec5\u662f\u6280\u672f\uff0c\u8fd8\u6709\u4f60\u5728\u4e0d\u540c\u573a\u666f\u4e0b\u7684\u95ee\u9898\u5904\u7406\u80fd\u529b<\/p>\n<p style=\"color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5176\u6b21\uff0c<strong style=\"color: #916dd5; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\">\u54b1\u4eec\u53ef\u4ee5\u8865\u5145\u4e00\u4e9b\u5177\u4f53\u7684\u6280\u672f\u7ec6\u8282<\/strong>\uff0c\u6bd4\u5982\u5982\u4f55\u83b7\u53d6\u5230dump\u6587\u4ef6\uff0c\u5982\u4f55\u4f7f\u7528JVisualVM\u6216\u8005Eclipse MAT\u8fdb\u884c\u5185\u5b58\u5206\u6790\uff0c\u5982\u4f55\u901a\u8fc7\u8c03\u6574\u5783\u573e\u56de\u6536\u7b56\u7565\u6765\u4f18\u5316\u5185\u5b58\u7ba1\u7406\u7b49\u3002<\/p>\n<p style=\"color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong style=\"color: #916dd5; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\">\u5982\u679c\u8bf4\u9762\u8bd5\u6709\u5fc5\u6740\u6280\uff0c\u90a3\u4e48\u4e00\u5b9a\u662f\uff1a\u771f\u5b9e\u7684\u7ecf\u5386+\u5177\u4f53\u7684\u6280\u672f\u7ec6\u8282<\/strong><\/p>\n<hr style=\"margin-top: 10px; margin-bottom: 10px; border-style: solid none none; border-width: 2px 3px 3px; border-color: #d9b8fa rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 0px; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: 1px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\" \/>\n<figure style=\"margin-top: 10px; margin-bottom: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><\/figure>\n<section class=\"mp_profile_iframe_wrp\"><\/section>\n<p style=\"color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong style=\"color: #916dd5; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\">\u4f5c\u8005\u7b80\u4ecb<\/strong>\uff1a<\/p>\n<ol class=\"list-paddingleft-1\" style=\"margin-top: 8px; margin-bottom: 8px; padding-left: 25px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\">\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u5927\u4e09\u9000\u5b66\uff0c\u521b\u4e1a\u3001\u6c42\u804c\u3001\u81ea\u8003\uff0c\u4e00\u8def\u5347\u7ea7<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">7\u5e74it\u4ece\u4e1a\u7ecf\u9a8c\uff0c\u591a\u4e2a\u5f00\u6e90\u793e\u533acontributor<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u4e13\u6ce8\u5206\u4eab\u6210\u957f\u8def\u4e0a\u7684\u6240\u609f\u6240\u5f97<\/p>\n<\/section>\n<\/li>\n<li>\n<section style=\"margin-top: 5px; margin-bottom: 5px; color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0em;\">\n<p style=\"line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\">\u957f\u671f\u63a2\u7d22 <code style=\"color: #916dd5; line-height: 1.8em; letter-spacing: 0em; height: auto; background: none 0% 0% \/ auto no-repeat scroll padding-box border-box rgba(27, 31, 35, 0.05); width: auto; margin-left: 2px; margin-right: 2px; padding: 2px 4px; border-style: none; border-width: 3px; border-color: #000000 rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all;\">\u4e2a\u4eba\u6210\u957f<\/code>\uff5c<code style=\"color: #916dd5; line-height: 1.8em; letter-spacing: 0em; height: auto; background: none 0% 0% \/ auto no-repeat scroll padding-box border-box rgba(27, 31, 35, 0.05); width: auto; margin-left: 2px; margin-right: 2px; padding: 2px 4px; border-style: none; border-width: 3px; border-color: #000000 rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all;\">\u804c\u4e1a\u53d1\u5c55<\/code>\uff5c<code style=\"color: #916dd5; line-height: 1.8em; letter-spacing: 0em; height: auto; background: none 0% 0% \/ auto no-repeat scroll padding-box border-box rgba(27, 31, 35, 0.05); width: auto; margin-left: 2px; margin-right: 2px; padding: 2px 4px; border-style: none; border-width: 3px; border-color: #000000 rgba(0, 0, 0, 0.4) rgba(0, 0, 0, 0.4); border-radius: 4px; font-family: 'Operator Mono', Consolas, Monaco, Menlo, monospace; word-break: break-all;\">\u526f\u4e1a\u63a2\u7d22<\/code><\/p>\n<\/section>\n<\/li>\n<\/ol>\n<p style=\"color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong style=\"color: #916dd5; background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: no-repeat; background-size: auto; width: auto; height: auto; border-style: none; border-width: 3px; border-color: rgba(0, 0, 0, 0.4); border-radius: 0px;\">\u63a8\u8350\u9605\u8bfb<\/strong>\uff1a<\/p>\n<p style=\"color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><a style=\"color: #916dd5; font-weight: bold; border-style: none none solid; border-width: 1px; border-color: #1e6bb8 #1e6bb8 #916dd5; border-radius: 0px;\" href=\"https:\/\/mp.weixin.qq.com\/s?__biz=MzU5ODg2Njk4OA==&amp;mid=2247485406&amp;idx=1&amp;sn=a3ee849d527743a7790f368dcc7c9efe&amp;scene=21#wechat_redirect\" data-linktype=\"2\" target=\"_blank\"  rel=\"nofollow\" >\u7f8e\u56e2\u4e00\u9762\uff0c\u53d1\u751fOOM\u4e86\uff0c\u7a0b\u5e8f\u8fd8\u80fd\u7ee7\u7eed\u8fd0\u884c\u5417\uff1f<\/a><\/p>\n<p style=\"color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><a style=\"color: #916dd5; font-weight: bold; border-style: none none solid; border-width: 1px; border-color: #1e6bb8 #1e6bb8 #916dd5; border-radius: 0px;\" href=\"https:\/\/mp.weixin.qq.com\/s?__biz=MzU5ODg2Njk4OA==&amp;mid=2247485235&amp;idx=1&amp;sn=b8cb1a46a37e7cd2fb4f63fbff116464&amp;chksm=febcea70c9cb6366728f8bf3c57af83c5d7a11a17e660967920cb4508e93675565a7b1ff8ce8&amp;scene=21#wechat_redirect\" data-linktype=\"2\" target=\"_blank\"  rel=\"nofollow\" >\u7f8e\u56e2\u4e00\u9762\u95ee\u6211i++\u8ddf++i\u7684\u533a\u522b\u662f\u4ec0\u4e48<\/a><\/p>\n<p style=\"color: #595959; font-size: 14px; line-height: 1.8em; letter-spacing: 0.02em; text-indent: 0em; padding-top: 8px; padding-bottom: 8px;\" data-tool=\"mdnice\u7f16\u8f91\u5668\"><a style=\"color: #916dd5; font-weight: bold; border-style: none none solid; border-width: 1px; border-color: #1e6bb8 #1e6bb8 #916dd5; border-radius: 0px;\" href=\"https:\/\/mp.weixin.qq.com\/s?__biz=MzU5ODg2Njk4OA==&amp;mid=2247484390&amp;idx=1&amp;sn=b469cde5f32e9eb8c92345e6fd34f688&amp;chksm=febceea5c9cb67b326c2095c954b0b95f1fb9373d51e7197bb46267a7dd162df37c4cc723543&amp;scene=21#wechat_redirect\" data-linktype=\"2\" target=\"_blank\"  rel=\"nofollow\" >\u9762\u8bd5\u5fc5\u6740\u6280\uff0c\u8bb2\u4e00\u8bb2Spring\u4e2d\u7684\u5faa\u73af\u4f9d\u8d56<\/a><\/p>\n<p style=\"display: none;\">\n<blockquote><p>\u672c\u7bc7\u6587\u7ae0\u6765\u6e90\u4e8e\u5fae\u4fe1\u516c\u4f17\u53f7: \u660e\u667a\u8bf4<\/p>\n<p>https:\/\/mp.weixin.qq.com\/s?__biz=MzU5ODg2Njk4OA==&amp;mid=2247485460&amp;idx=1&amp;sn=42ec73dc74c42f1d73a33aba51f327ac&amp;chksm=febce557c9cb6c4194e20ce5bb321636e88b031f21ab335414a703cbb7e02a2d9903367e3103&amp;cur_album_id=1525097642517659655&amp;scene=189#wechat_redirect<\/p><\/blockquote>\n<\/div>\n","raw":"","protected":false},"excerpt":{"rendered":"<p>\u54c8\u55bd\uff0c\u5927\u5bb6\u597d\uff0c\u6211\u662f\u660e\u667a \u63a5\u4e0b\u6765\u7684\u51e0\u7bc7\u6587\u7ae0\u6211\u4f1a\u7ed9\u5927\u5bb6\u4ecb\u7ecd\u4e00\u7cfb\u5217\u9762\u8bd5\u9898\uff0c\u8fd9\u4e9b\u9762\u8bd5\u9898\u6709\u4e9b\u662f\u6211\u9762\u8bd5\u7684\u65f6\u5019\u522b\u4eba\u95ee\u6211\u7684\uff0c\u6709\u4e9b\u662f\u6211\u81ea\u5df1\u4f5c\u4e3a\u9762\u8bd5\u5b98 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":4752,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[30],"tags":[],"class_list":["post-4759","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-30"],"post_thumbnail_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240528154213899-150x86.jpeg","content_first_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240528154217688.jpeg","post_medium_image_300":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240528154213899.jpeg","post_thumbnail_image_624":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240528154213899.jpeg","post_frist_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240528154217688.jpeg","post_medium_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240528154213899.jpeg","post_large_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240528154213899.jpeg","post_full_image":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240528154213899.jpeg","post_all_images":[{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240528154217688.jpeg","id":"image0"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240528154217688.jpeg","id":"image1"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240528154219409.gif","id":"image2"},{"imagesurl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2024\/05\/20240528154219409.gif","id":"image3"}],"videoAdId":"","listAd":"0","listAdId":"","listAdEvery":6,"total_comments":0,"category_name":"\u9762\u8bd5","post_date":"2024-05-22","like_count":"0","praiseWord":"\u9f13\u52b1","copyright_state":"","excitationAd":"0","rewardedVideoAdId":"","detailAdId":"","detailAd":"0","enterpriseMinapp":"0","audios":[],"postImageUrl":"https:\/\/wp-moto-1258805347.cos.ap-shanghai.myqcloud.com\/2023\/05\/20230519082947553.jpg","avatarurls":[],"related_posts":null,"pageviews":261,"next_post_id":4141,"next_post_title":"\u9762\u8bd5\u5b98\uff1a\u88c5\u9970\u5668\u6a21\u5f0f\u548c\u4ee3\u7406\u6a21\u5f0f\u4e4b\u95f4\u7684\u533a\u522b\u662f\u4ec0\u4e48\uff1f\u5e76\u8bf4\u660e\u5404\u81ea\u9002\u5408\u7684\u573a\u666f","previous_post_id":4137,"previous_post_title":"\u9762\u8bd5\u5b98\uff1a\u89e3\u91ca\u4fe1\u53f7\u91cf\uff08Semaphore\uff09\u4e0e\u4e92\u65a5\u91cf\uff08Mutex\uff09\u7684\u533a\u522b\u662f\u4ec0\u4e48\uff1f","_links":{"self":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/4759","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/comments?post=4759"}],"version-history":[{"count":2,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/4759\/revisions"}],"predecessor-version":[{"id":6469,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/posts\/4759\/revisions\/6469"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media\/4752"}],"wp:attachment":[{"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/media?parent=4759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/categories?post=4759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xinchewhd.com.cn\/index.php\/wp-json\/wp\/v2\/tags?post=4759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}