{"id":80070,"date":"2026-03-04T09:02:02","date_gmt":"2026-03-04T01:02:02","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/80070.html"},"modified":"2026-03-04T09:02:02","modified_gmt":"2026-03-04T01:02:02","slug":"jvm-26-%e9%9d%a2%e8%af%95%e9%a2%9812%ef%bc%9a%e7%b3%bb%e7%bb%9foom%e4%b8%8efull-gc%e5%ba%94%e8%af%a5%e6%80%8e%e4%b9%88%e5%8a%9e%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/80070.html","title":{"rendered":"JVM--26-\u9762\u8bd5\u989812\uff1a\u7cfb\u7edfOOM\u4e0eFull GC\u5e94\u8be5\u600e\u4e48\u529e\uff1f"},"content":{"rendered":"<h2>\u6df1\u5165 JVM \u9762\u8bd5\u7bc7&#xff1a;OOM \u4e0e Full GC \u7684\u7ec8\u6781\u653b\u9632\u6307\u5357<\/h2>\n<p>\u4f5c\u8005&#xff1a;Weisian<br \/>\n\u53d1\u5e03\u65f6\u95f4&#xff1a;2026\u5e742\u6708<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304010158-69a78486b3243.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<p>&#x1f4cc; \u7cfb\u5217\u5bfc\u8bfb&#xff1a;<br \/>\n\u5728\u4e0a\u4e00\u7bc7\u6587\u7ae0\u300a\u4e0d\u505c\u670d\u52a1\u4fee\u6539 JVM \u53c2\u6570\u300b\u4e2d&#xff0c;\u6211\u4eec\u638c\u63e1\u4e86\u751f\u4ea7\u73af\u5883\u7684\u201c\u5fae\u521b\u624b\u672f\u201d\u6280\u5de7\u3002\u4eca\u5929&#xff0c;\u6211\u4eec\u5c06\u76f4\u9762 Java \u5de5\u7a0b\u5e08\u6700\u6050\u60e7\u7684\u4e24\u4e2a\u5669\u68a6\u2014\u2014OOM (Out of Memory) \u4e0e \u9891\u7e41 Full GC\u3002<\/p>\n<p>\u5728\u9ad8\u5e76\u53d1\u3001\u5927\u6d41\u91cf\u573a\u666f\u4e0b&#xff0c;\u5b83\u4eec\u662f\u538b\u57ae\u670d\u52a1\u7684\u6700\u540e\u4e00\u6839\u7a3b\u8349&#xff1b;\u5728\u9762\u8bd5\u573a\u4e0a&#xff0c;\u5b83\u4eec\u662f\u533a\u5206\u201c CRUD \u5de5\u7a0b\u5e08\u201d\u4e0e\u201c\u8d44\u6df1\u67b6\u6784\u5e08\u201d\u7684\u5206\u6c34\u5cad\u3002<\/p>\n<p>\u5982\u679c\u8bf4\u53c2\u6570\u8c03\u4f18\u662f\u201c\u672f\u201d&#xff0c;\u90a3\u4e48\u7406\u89e3\u5185\u5b58\u6a21\u578b\u4e0e GC \u884c\u4e3a\u80cc\u540e\u7684\u201c\u9053\u201d&#xff0c;\u624d\u662f\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\u7684\u6839\u672c\u3002\u672c\u6587\u5c06\u4ece \u539f\u7406\u8ba4\u77e5\u3001\u89e6\u53d1\u673a\u5236\u3001\u89c4\u907f\u7b56\u7565\u3001\u6392\u67e5 SOP\u3001\u9762\u8bd5\u901a\u5173 \u4e94\u4e2a\u7ef4\u5ea6&#xff0c;\u5e26\u4f60\u5f7b\u5e95\u653b\u514b\u8fd9\u4e24\u5ea7\u5927\u5c71\u3002<\/p>\n<hr \/>\n<h3>\u4e00\u3001\u8ba4\u77e5\u91cd\u5851&#xff1a;\u4e0d\u662f\u6240\u6709\u201c\u5185\u5b58\u4e0d\u8db3\u201d\u90fd\u53eb OOM<\/h3>\n<p>\u5f88\u591a\u521d\u4e2d\u7ea7\u5de5\u7a0b\u5e08\u4e00\u9047\u5230 OOM&#xff0c;\u7b2c\u4e00\u53cd\u5e94\u5c31\u662f\u201c\u52a0\u5185\u5b58\u201d&#xff08;-Xmx&#xff09;\u3002\u8fd9\u662f\u5178\u578b\u7684\u6cbb\u6807\u4e0d\u6cbb\u672c&#xff0c;\u751a\u81f3\u53ef\u80fd\u63a9\u76d6\u771f\u6b63\u7684\u5185\u5b58\u6cc4\u6f0f&#xff0c;\u5bfc\u81f4\u95ee\u9898\u5728\u6df1\u591c\u7206\u53d1\u3002<\/p>\n<p>JVM \u89c4\u8303\u5b9a\u4e49\u4e86\u591a\u79cd\u5185\u5b58\u533a\u57df&#xff0c;\u4e0d\u540c\u7684 OOM \u5bf9\u5e94\u5b8c\u5168\u4e0d\u540c\u7684\u6839\u56e0\u548c\u89e3\u6cd5\u3002\u8bf7\u52a1\u5fc5\u5efa\u7acb\u4ee5\u4e0b\u5206\u7c7b\u8ba4\u77e5&#xff1a;<\/p>\n<h4>&#x1f4ca; \u4e94\u5927\u6838\u5fc3 OOM \u7c7b\u578b\u5168\u666f\u56fe<\/h4>\n<table>\n<tr>OOM \u7c7b\u578b\u5f02\u5e38\u4fe1\u606f\u5173\u952e\u5b57\u6839\u672c\u539f\u56e0\u80fd\u5426\u9760\u201c\u52a0\u5185\u5b58\u201d\u89e3\u51b3&#xff1f;\u98ce\u9669\u7b49\u7ea7<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">Java heap space<\/td>\n<td align=\"left\">java.lang.OutOfMemoryError: Java heap space<\/td>\n<td align=\"left\">\u5806\u5185\u5b58\u8017\u5c3d\u3002\u5bf9\u8c61\u521b\u5efa\u901f\u5ea6 &gt; GC \u56de\u6536\u901f\u5ea6&#xff0c;\u6216\u5b58\u5728\u5185\u5b58\u6cc4\u6f0f\u3002<\/td>\n<td align=\"center\">\u274c (\u53ef\u80fd\u63a9\u76d6\u6cc4\u6f0f)<\/td>\n<td align=\"center\">&#x1f534; \u9ad8\u5371<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">GC overhead limit<\/td>\n<td align=\"left\">java.lang.OutOfMemoryError: GC overhead limit exceeded<\/td>\n<td align=\"left\">CPU \u7a7a\u8f6c\u3002GC \u8017\u65f6 &gt;98% \u4e14\u56de\u6536\u5185\u5b58 &lt;2%\u3002\u7cfb\u7edf\u5df2\u6fd2\u4e34\u5d29\u6e83\u3002<\/td>\n<td align=\"center\">\u274c (\u9700\u4f18\u5316\u4ee3\u7801\u903b\u8f91)<\/td>\n<td align=\"center\">&#x1f534; \u6781\u9ad8\u5371<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">Metaspace<\/td>\n<td align=\"left\">java.lang.OutOfMemoryError: Metaspace<\/td>\n<td align=\"left\">\u5143\u7a7a\u95f4\u8017\u5c3d\u3002\u52a8\u6001\u4ee3\u7406\u7c7b\u8fc7\u591a\u3001\u52a0\u8f7d JAR \u5305\u8fc7\u591a\u3002<\/td>\n<td align=\"center\">\u26a0\ufe0f (\u4e34\u65f6\u6709\u6548&#xff0c;\u975e\u6839\u672c)<\/td>\n<td align=\"center\">&#x1f7e0; \u4e2d\u9ad8\u5371<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">Direct buffer<\/td>\n<td align=\"left\">java.lang.OutOfMemoryError: Direct buffer memory<\/td>\n<td align=\"left\">\u5806\u5916\u5185\u5b58\u6ea2\u51fa\u3002NIO DirectByteBuffer \u5206\u914d\u8fc7\u591a\u4e14\u672a\u91ca\u653e\u3002<\/td>\n<td align=\"center\">\u274c (\u9700\u63a7\u5236\u5806\u5916\u4f7f\u7528)<\/td>\n<td align=\"center\">&#x1f7e0; \u4e2d\u9ad8\u5371<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">StackOverflow<\/td>\n<td align=\"left\">java.lang.StackOverflowError<\/td>\n<td align=\"left\">\u7ebf\u7a0b\u6808\u6ea2\u51fa\u3002\u9012\u5f52\u6b7b\u5faa\u73af\u6216\u8c03\u7528\u94fe\u8fc7\u6df1\u3002<\/td>\n<td align=\"center\">\u26a0\ufe0f (\u53ef\u8c03 -Xss&#xff0c;\u4f46\u5e94\u4fee\u903b\u8f91)<\/td>\n<td align=\"center\">&#x1f7e1; \u4e2d\u5371<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&#x1f4a1; \u6838\u5fc3\u6d1e\u5bdf&#xff1a;<br \/>\nOOM \u53ea\u662f\u7ed3\u679c&#xff0c;\u4e0d\u662f\u539f\u56e0\u3002<\/p>\n<ul>\n<li>Heap Space \u901a\u5e38\u610f\u5473\u7740\u5bf9\u8c61\u592a\u591a\u6216\u6ca1\u91ca\u653e\u3002<\/li>\n<li>GC Overhead \u610f\u5473\u7740\u5783\u573e\u592a\u591a&#xff0c;GC \u7ebf\u7a0b\u7d2f\u6b7b\u4e86\u3002<\/li>\n<li>Metaspace \u610f\u5473\u7740\u7c7b\u592a\u591a\u3002<br \/>\n\u771f\u6b63\u7684\u9ad8\u624b&#xff0c;\u662f\u5728 OOM \u53d1\u751f\u524d&#xff0c;\u901a\u8fc7\u76d1\u63a7\u8d8b\u52bf\u63d0\u524d\u5e72\u9884\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>\u4e8c\u3001Full GC&#xff1a;\u6027\u80fd\u6740\u624b\u7684\u89e6\u53d1\u673a\u5236\u4e0e\u9632\u5fa1<\/h3>\n<p>Full GC \u662f Stop-The-World (STW) \u6700\u4e25\u91cd\u7684 GC \u4e8b\u4ef6\u3002\u5728\u7535\u5546\u5927\u4fc3\u3001\u652f\u4ed8\u4ea4\u6613\u7b49\u4f4e\u5ef6\u8fdf\u573a\u666f\u4e2d&#xff0c;\u4e00\u6b21 Full GC &#061; \u4e00\u6b21 P0 \u7ea7\u4e8b\u6545&#xff08;\u63a5\u53e3\u8d85\u65f6\u3001\u7528\u6237\u6d41\u5931&#xff09;\u3002<\/p>\n<h4>2.1 Young GC vs Full GC&#xff1a;\u672c\u8d28\u533a\u522b<\/h4>\n<p>\u5728\u6df1\u5165\u4e4b\u524d&#xff0c;\u5fc5\u987b\u5398\u6e05\u4e24\u8005\u7684\u8fb9\u754c&#xff1a;<\/p>\n<table>\n<tr>\u7ef4\u5ea6Young GC&#xff08;Minor GC&#xff09;Full GC&#xff08;Major GC&#xff09;<\/tr>\n<tbody>\n<tr>\n<td>\u56de\u6536\u533a\u57df<\/td>\n<td>\u4ec5\u65b0\u751f\u4ee3&#xff08;Eden &#043; Survivor&#xff09;<\/td>\n<td>\u5168\u5806&#xff08;\u65b0\u751f\u4ee3&#043;\u8001\u5e74\u4ee3&#043;\u5143\u7a7a\u95f4&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u89e6\u53d1\u6761\u4ef6<\/td>\n<td>Eden \u533a\u6ee1<\/td>\n<td>\u8001\u5e74\u4ee3\/\u5143\u7a7a\u95f4\u4e0d\u8db3\u3001\u664b\u5347\u5931\u8d25\u7b49<\/td>\n<\/tr>\n<tr>\n<td>STW \u65f6\u957f<\/td>\n<td>\u6beb\u79d2\u7ea7&#xff08;\u901a\u5e38 &lt; 50ms&#xff09;<\/td>\n<td>\u767e\u6beb\u79d2~\u79d2\u7ea7&#xff08;\u751a\u81f3\u66f4\u957f&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u89e6\u53d1\u9891\u7387<\/td>\n<td>\u9ad8&#xff08;\u6bcf\u79d2\u6570\u6b21&#xff09;<\/td>\n<td>\u4f4e&#xff08;\u5206\u949f\/\u5c0f\u65f6\u7ea7&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u4e1a\u52a1\u5f71\u54cd<\/td>\n<td>\u51e0\u4e4e\u65e0\u611f\u77e5<\/td>\n<td>\u670d\u52a1\u5361\u987f\u3001\u8d85\u65f6\u3001\u63a5\u53e3\u62a5\u9519<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304010158-69a78486caea1.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>2.2 \u89e6\u53d1 Full GC \u7684\u4e94\u5927\u201c\u6b7b\u4ea1\u573a\u666f\u201d (\u9762\u8bd5\u5fc5\u80cc)<\/h4>\n<li>\u8001\u5e74\u4ee3\u7a7a\u95f4\u4e0d\u8db3\n<ul>\n<li>\u73b0\u8c61&#xff1a;\u5bf9\u8c61\u664b\u5347\u8fc7\u5feb&#xff0c;\u6216\u5927\u5bf9\u8c61\u76f4\u63a5\u8fdb\u5165\u8001\u5e74\u4ee3\u3002<\/li>\n<li>\u6839\u56e0&#xff1a;-XX:PretenureSizeThreshold \u8bbe\u7f6e\u4e0d\u5f53&#xff0c;\u6216\u4ee3\u7801\u4e2d\u5b58\u5728\u957f\u751f\u547d\u5468\u671f\u5bf9\u8c61\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u5143\u7a7a\u95f4 (Metaspace) \u4e0d\u8db3\n<ul>\n<li>\u73b0\u8c61&#xff1a;\u52a8\u6001\u751f\u6210\u7c7b\u7206\u70b8\u3002<\/li>\n<li>\u6839\u56e0&#xff1a;Spring AOP\/CGLib \u4ee3\u7406\u8fc7\u591a\u3001Groovy \u811a\u672c\u52a8\u6001\u7f16\u8bd1\u3001\u70ed\u90e8\u7f72\u6846\u67b6\u6ee5\u7528\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u663e\u5f0f\u8c03\u7528 System.gc()\n<ul>\n<li>\u73b0\u8c61&#xff1a;\u65e5\u5fd7\u4e2d\u51fa\u73b0 System.gc() invoked\u3002<\/li>\n<li>\u6839\u56e0&#xff1a;\u7b2c\u4e09\u65b9\u5e93&#xff08;\u5982 NIO\u3001RMI&#xff09;\u6216\u4e0d\u89c4\u8303\u7684\u4e1a\u52a1\u4ee3\u7801\u4e3b\u52a8\u89e6\u53d1\u3002\u9ed8\u8ba4\u5efa\u8bae\u7981\u7528\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u664b\u5347\u5931\u8d25 (Promotion Failure)\n<ul>\n<li>\u73b0\u8c61&#xff1a;Young GC \u65f6&#xff0c;Survivor \u533a\u653e\u4e0d\u4e0b&#xff0c;\u8bd5\u56fe\u664b\u5347\u5230\u8001\u5e74\u4ee3&#xff0c;\u4f46\u8001\u5e74\u4ee3\u4e5f\u6ca1\u6709\u8fde\u7eed\u7a7a\u95f4\u3002<\/li>\n<li>\u6839\u56e0&#xff1a;\u5185\u5b58\u788e\u7247\u5316\u4e25\u91cd&#xff0c;\u6216\u8001\u5e74\u4ee3\u9884\u7559\u7a7a\u95f4\u4e0d\u8db3\u3002<\/li>\n<\/ul>\n<\/li>\n<li>CMS \u5e76\u53d1\u6a21\u5f0f\u5931\u8d25 (Concurrent Mode Failure)\n<ul>\n<li>\u73b0\u8c61&#xff1a;CMS \u6536\u96c6\u5668\u7279\u6709\u3002\u5e76\u53d1\u6807\u8bb0\/\u6e05\u7406\u8fd8\u6ca1\u505a\u5b8c&#xff0c;\u8001\u5e74\u4ee3\u5c31\u6ee1\u4e86\u3002<\/li>\n<li>\u540e\u679c&#xff1a;\u9000\u5316\u4e3a Serial Old \u5355\u7ebf\u7a0b Full GC&#xff0c;STW \u65f6\u95f4\u6781\u957f\u3002<\/li>\n<\/ul>\n<\/li>\n<p>&#x1f4cc; \u6ce8\u610f&#xff1a;\u867d\u7136 G1\u3001ZGC \u7b49\u73b0\u4ee3\u6536\u96c6\u5668\u5927\u5e45\u51cf\u5c11\u4e86 Full GC&#xff0c;\u4f46\u5728\u6781\u7aef\u5185\u5b58\u538b\u529b\u4e0b&#xff08;\u5982\u5806\u4f7f\u7528\u7387\u63a5\u8fd1 100%&#xff09;&#xff0c;\u5b83\u4eec\u4f9d\u7136\u4f1a\u89e6\u53d1 Full GC \u4f5c\u4e3a\u6700\u540e\u7684\u515c\u5e95\u624b\u6bb5\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304010158-69a78486ef8bf.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<hr \/>\n<h3>\u4e09\u3001\u9632\u5fa1\u5de5\u4e8b&#xff1a;\u5982\u4f55\u907f\u514d\/\u51cf\u5c11 Full GC&#xff1f;<\/h3>\n<p>\u907f\u514d Full GC \u7684\u6838\u5fc3\u601d\u60f3\u662f&#xff1a;\u63a7\u5236\u5bf9\u8c61\u8fdb\u5165\u8001\u5e74\u4ee3\u7684\u901f\u5ea6&#xff0c;\u5e76\u8ba9 GC \u5c3d\u53ef\u80fd\u5728\u65b0\u751f\u4ee3\u5b8c\u6210\u56de\u6536\u3002<\/p>\n<h4>&#x1f6e1;\ufe0f \u7b56\u7565\u4e00&#xff1a;\u7cbe\u7ec6\u5316\u5185\u5b58\u53c2\u6570\u914d\u7f6e<\/h4>\n<p>\u4e0d\u8981\u76f2\u76ee\u8bbe\u7f6e -Xmx&#xff0c;\u8981\u5173\u6ce8\u6bd4\u4f8b\u548c\u9608\u503c&#xff1a;<\/p>\n<p><span class=\"token comment\"># 1. \u56fa\u5b9a\u5806\u5927\u5c0f&#xff0c;\u907f\u514d\u8fd0\u884c\u65f6\u52a8\u6001\u6269\u5bb9\u5e26\u6765\u7684\u6296\u52a8<\/span><br \/>\n<span class=\"token parameter variable\">-Xms4g<\/span> <span class=\"token parameter variable\">-Xmx4g<\/span><\/p>\n<p><span class=\"token comment\"># 2. \u8c03\u6574\u65b0\u751f\u4ee3\u4e0e\u8001\u5e74\u4ee3\u6bd4\u4f8b (\u9ed8\u8ba4 1:2)<\/span><br \/>\n<span class=\"token comment\"># \u9002\u5f53\u589e\u5927\u65b0\u751f\u4ee3&#xff0c;\u8ba9\u5bf9\u8c61\u591a\u6d3b\u4e00\u4f1a\u513f&#xff0c;\u51cf\u5c11\u664b\u5347<\/span><br \/>\n<span class=\"token parameter variable\">-XX:NewRatio<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">2<\/span> <\/p>\n<p><span class=\"token comment\"># 3. \u8c03\u6574 Eden \u4e0e Survivor \u6bd4\u4f8b (\u9ed8\u8ba4 8:1:1)<\/span><br \/>\n<span class=\"token parameter variable\">-XX:SurvivorRatio<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">8<\/span><\/p>\n<p><span class=\"token comment\"># 4. \u63a7\u5236\u5bf9\u8c61\u664b\u5347\u5e74\u9f84 (\u9ed8\u8ba4 15)<\/span><br \/>\n<span class=\"token comment\"># \u9002\u5f53\u964d\u4f4e&#xff0c;\u8ba9\u7591\u4f3c\u6cc4\u6f0f\u7684\u5bf9\u8c61\u65e9\u70b9\u66b4\u9732&#xff0c;\u6216\u63d0\u9ad8\u8ba9\u77ed\u547d\u5bf9\u8c61\u591a\u71ac\u51e0\u8f6e<\/span><br \/>\n<span class=\"token parameter variable\">-XX:MaxTenuringThreshold<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">10<\/span><\/p>\n<p><span class=\"token comment\"># 5. \u3010G1 \u4e13\u5c5e\u3011\u63d0\u524d\u89e6\u53d1\u5e76\u53d1\u6807\u8bb0&#xff0c;\u9884\u9632 Full GC<\/span><br \/>\n<span class=\"token comment\"># \u5f53\u5806\u5360\u7528\u8fbe\u5230 45% \u65f6\u5c31\u5f00\u59cb\u6807\u8bb0&#xff0c;\u7559\u51fa\u7f13\u51b2\u65f6\u95f4<\/span><br \/>\n<span class=\"token parameter variable\">-XX:InitiatingHeapOccupancyPercent<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">45<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304010159-69a7848721e2f.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>&#x1f6e1;\ufe0f \u7b56\u7565\u4e8c&#xff1a;\u5173\u95ed\u663e\u5f0f GC (\u751f\u4ea7\u73af\u5883\u94c1\u5f8b)<\/h4>\n<p>\u9664\u975e\u4f60\u6709\u6781\u5176\u7279\u6b8a\u7684\u7406\u7531&#xff0c;\u5426\u5219\u5fc5\u987b\u7981\u6b62\u4ee3\u7801\u4e2d\u7684 System.gc() \u8c03\u7528&#xff1a;<\/p>\n<p><span class=\"token parameter variable\">-XX:&#043;DisableExplicitGC<\/span><\/p>\n<p>\u26a0\ufe0f \u526f\u4f5c\u7528\u63d0\u793a&#xff1a;\u8fd9\u4f1a\u4f7f\u5f97 DirectByteBuffer \u7684\u6e05\u7406\u4f9d\u8d56 JVM \u81ea\u52a8\u89e6\u53d1\u3002\u82e5\u5927\u91cf\u4f7f\u7528\u5806\u5916\u5185\u5b58&#xff0c;\u9700\u914d\u5408 -XX:MaxDirectMemorySize \u9650\u5236&#xff0c;\u9632\u6b62\u5806\u5916 OOM\u3002<\/p>\n<h4>&#x1f6e1;\ufe0f \u7b56\u7565\u4e09&#xff1a;\u9009\u62e9\u5408\u9002\u7684\u5783\u573e\u6536\u96c6\u5668<\/h4>\n<p>\u6839\u636e\u4e1a\u52a1\u573a\u666f\u201c\u91cf\u4f53\u88c1\u8863\u201d&#xff1a;<\/p>\n<table>\n<tr>\u4e1a\u52a1\u573a\u666f\u63a8\u8350\u6536\u96c6\u5668\u5173\u952e\u4f18\u52bf<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u8d85\u4f4e\u5ef6\u8fdf (&lt;50ms)<\/td>\n<td align=\"left\">ZGC \/ Shenandoah<\/td>\n<td align=\"left\">STW \u65f6\u95f4\u4e9a\u6beb\u79d2\u7ea7&#xff0c;\u51e0\u4e4e\u65e0\u611f\u77e5<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u5927\u5806\u5185\u5b58 (&gt;32GB)<\/td>\n<td align=\"left\">G1<\/td>\n<td align=\"left\">\u53ef\u9884\u6d4b\u7684\u505c\u987f\u65f6\u95f4&#xff0c;\u81ea\u52a8\u5206\u533a\u7ba1\u7406<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u541e\u5410\u4f18\u5148 (\u540e\u53f0\u6279\u5904\u7406)<\/td>\n<td align=\"left\">Parallel GC<\/td>\n<td align=\"left\">\u541e\u5410\u91cf\u6700\u9ad8&#xff0c;\u4f46 STW \u8f83\u957f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304010159-69a7848749010.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>&#x1f6e1;\ufe0f \u7b56\u7565\u56db&#xff1a;\u4ee3\u7801\u5c42\u9762\u7684\u201c\u6e90\u5934\u6cbb\u7406\u201d (\u6700\u91cd\u8981&#xff01;)<\/h4>\n<p>\u518d\u597d\u7684\u53c2\u6570\u4e5f\u6551\u4e0d\u4e86\u70c2\u4ee3\u7801\u3002<\/p>\n<ul>\n<li>\u8b66\u60d5\u9759\u6001\u96c6\u5408\u65e0\u9650\u589e\u957f<span class=\"token comment\">\/\/ \u274c \u9519\u8bef\u793a\u8303&#xff1a;\u9759\u6001 Map \u53ea\u589e\u4e0d\u51cf&#xff0c;\u6c38\u4e45\u6301\u6709\u5f15\u7528<\/span><br \/>\n<span class=\"token keyword\">private<\/span> <span class=\"token keyword\">static<\/span> <span class=\"token keyword\">final<\/span> <span class=\"token class-name\">Map<\/span><span class=\"token generics\"><span class=\"token punctuation\">&lt;<\/span><span class=\"token class-name\">String<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">User<\/span><span class=\"token punctuation\">&gt;<\/span><\/span> <span class=\"token constant\">CACHE<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">HashMap<\/span><span class=\"token generics\"><span class=\"token punctuation\">&lt;<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u2705 \u6b63\u786e\u793a\u8303&#xff1a;\u4f7f\u7528 LRU \u7f13\u5b58&#xff0c;\u9650\u5236\u5927\u5c0f<\/span><br \/>\n<span class=\"token keyword\">private<\/span> <span class=\"token keyword\">static<\/span> <span class=\"token keyword\">final<\/span> <span class=\"token class-name\">Map<\/span><span class=\"token generics\"><span class=\"token punctuation\">&lt;<\/span><span class=\"token class-name\">String<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">User<\/span><span class=\"token punctuation\">&gt;<\/span><\/span> <span class=\"token constant\">CACHE<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">LinkedHashMap<\/span><span class=\"token generics\"><span class=\"token punctuation\">&lt;<\/span><span class=\"token punctuation\">&gt;<\/span><\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">1000<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">0.75f<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token annotation punctuation\">&#064;Override<\/span><br \/>\n    <span class=\"token keyword\">protected<\/span> <span class=\"token keyword\">boolean<\/span> <span class=\"token function\">removeEldestEntry<\/span><span class=\"token punctuation\">(<\/span><span class=\"token class-name\">Map<span class=\"token punctuation\">.<\/span>Entry<\/span> eldest<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> <span class=\"token function\">size<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">1000<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u8d85\u8fc7\u9608\u503c\u81ea\u52a8\u6dd8\u6c70<\/span><br \/>\n    <span class=\"token punctuation\">}<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<\/li>\n<li>ThreadLocal \u5fc5\u987b remove()<br \/>\n\u5728\u7ebf\u7a0b\u6c60\u573a\u666f\u4e0b&#xff0c;\u7ebf\u7a0b\u590d\u7528\u4f1a\u5bfc\u81f4 ThreadLocal \u53d8\u91cf\u65e0\u6cd5\u56de\u6536&#xff0c;\u5f15\u53d1\u5185\u5b58\u6cc4\u6f0f\u3002<span class=\"token keyword\">try<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    userContext<span class=\"token punctuation\">.<\/span><span class=\"token function\">set<\/span><span class=\"token punctuation\">(<\/span>user<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token comment\">\/\/ \u4e1a\u52a1\u903b\u8f91&#8230;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span> <span class=\"token keyword\">finally<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    userContext<span class=\"token punctuation\">.<\/span><span class=\"token function\">remove<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u52a1\u5fc5\u5728 finally \u5757\u4e2d\u6e05\u7406<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<\/li>\n<li>\u5927\u5bf9\u8c61\u5806\u5916\u5316<br \/>\n\u5bf9\u4e8e\u8d85\u5927\u5b57\u8282\u6570\u7ec4\u3001\u6587\u4ef6\u6d41\u5904\u7406&#xff0c;\u8003\u8651\u4f7f\u7528 Netty ByteBuf \u6216 MappedByteBuffer \u5c06\u6570\u636e\u79fb\u81f3\u5806\u5916&#xff0c;\u51cf\u8f7b GC \u538b\u529b\u3002<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304010159-69a78487786c3.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<hr \/>\n<h3>\u56db\u3001\u5b9e\u6218 SOP&#xff1a;OOM \u6392\u67e5\u6807\u51c6\u5316\u6d41\u7a0b<\/h3>\n<p>\u7ebf\u4e0a\u53d1\u751f OOM \u65f6&#xff0c;\u9ec4\u91d1 5 \u5206\u949f\u51b3\u5b9a\u4e8b\u6545\u5f71\u54cd\u8303\u56f4\u3002\u8bf7\u4e25\u683c\u6267\u884c\u4ee5\u4e0b SOP&#xff08;\u6807\u51c6\u4f5c\u4e1a\u7a0b\u5e8f&#xff09;&#xff1a;<\/p>\n<h4>&#x1f6a8; \u9636\u6bb5\u4e00&#xff1a;\u73b0\u573a\u4fdd\u7559 (\u9884\u9632\u80dc\u4e8e\u6cbb\u7597)<\/h4>\n<p>\u786e\u4fdd\u6240\u6709\u751f\u4ea7\u670d\u52a1\u542f\u52a8\u65f6\u90fd\u5305\u542b\u4ee5\u4e0b\u53c2\u6570&#xff0c;\u8fd9\u662f\u6392\u67e5\u7684\u201c\u9ed1\u5323\u5b50\u201d&#xff1a;<\/p>\n<p><span class=\"token parameter variable\">-XX:&#043;HeapDumpOnOutOfMemoryError<\/span>          <span class=\"token comment\"># OOM \u65f6\u81ea\u52a8 Dump<\/span><br \/>\n<span class=\"token parameter variable\">-XX:HeapDumpPath<\/span><span class=\"token operator\">&#061;<\/span>\/data\/logs\/heap_oom.hprof <span class=\"token comment\"># \u6307\u5b9a Dump \u8def\u5f84 (\u786e\u4fdd\u78c1\u76d8\u7a7a\u95f4\u5145\u8db3)<\/span><br \/>\n<span class=\"token parameter variable\">-XX:OnOutOfMemoryError<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;kill -9 %p&#034;<\/span>      <span class=\"token comment\"># \u53ef\u9009&#xff1a;OOM \u540e\u81ea\u6740&#xff0c;\u9632\u6b62\u50f5\u5c38\u8fdb\u7a0b\u62d6\u7d2f\u96c6\u7fa4<\/span><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304010159-69a78487b669a.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>&#x1f50d; \u9636\u6bb5\u4e8c&#xff1a;\u5206\u6790\u4e0e\u5b9a\u4f4d (\u5de5\u5177\u94fe\u95ed\u73af)<\/h4>\n<p>\u62ff\u5230 .hprof \u6587\u4ef6\u540e&#xff0c;\u4f7f\u7528 Eclipse MAT (Memory Analyzer Tool) \u8fdb\u884c\u5206\u6790&#xff1a;<\/p>\n<li>\u770b Histogram (\u76f4\u65b9\u56fe)\n<ul>\n<li>\u6309 Shallow Heap (\u81ea\u8eab\u5927\u5c0f) \u6216 Instances (\u5b9e\u4f8b\u6570\u91cf) \u6392\u5e8f\u3002<\/li>\n<li>\u76ee\u6807&#xff1a;\u627e\u51fa\u6570\u91cf\u5f02\u5e38\u591a\u6216\u5360\u7528\u5185\u5b58\u6700\u5927\u7684\u7c7b&#xff08;\u5982 byte[], HashMap$Node, \u4e1a\u52a1\u5b9e\u4f53\u7c7b&#xff09;\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u770b Dominator Tree (\u652f\u914d\u6811)\n<ul>\n<li>\u6309 Retained Heap (\u4fdd\u7559\u5927\u5c0f&#xff0c;\u5373\u8be5\u5bf9\u8c61\u56de\u6536\u540e\u80fd\u91ca\u653e\u7684\u603b\u5185\u5b58) \u6392\u5e8f\u3002<\/li>\n<li>\u76ee\u6807&#xff1a;\u627e\u5230\u90a3\u4e2a\u201c\u5360\u636e\u9ad8\u4f4d\u201d\u7684\u6839\u5bf9\u8c61\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u8ffd\u8e2a GC Roots (\u5173\u952e\u4e00\u6b65)\n<ul>\n<li>\u53f3\u952e\u53ef\u7591\u5bf9\u8c61 -&gt; Merge Shortest Paths to GC Roots -&gt; exclude weak\/soft references\u3002<\/li>\n<li>\u76ee\u6807&#xff1a;\u67e5\u770b\u662f\u8c01&#xff08;\u54ea\u4e2a\u9759\u6001\u53d8\u91cf\u3001\u54ea\u4e2a\u7ebf\u7a0b\u3001\u54ea\u4e2a\u7f13\u5b58&#xff09;\u5f3a\u5f15\u7528\u4e86\u5b83&#xff0c;\u5bfc\u81f4\u65e0\u6cd5\u56de\u6536\u3002<\/li>\n<\/ul>\n<\/li>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304010159-69a78487f0f02.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<h4>&#x1f9d0; \u9636\u6bb5\u4e09&#xff1a;\u5b9a\u6027\u5206\u6790 (\u6cc4\u6f0f vs \u6ea2\u51fa)<\/h4>\n<table>\n<tr>\u7279\u5f81\u5185\u5b58\u6cc4\u6f0f (Leak)\u5185\u5b58\u6ea2\u51fa (Overflow)<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u5806\u5185\u5b58\u8d8b\u52bf<\/td>\n<td align=\"left\">\u952f\u9f7f\u72b6&#xff1a;GC \u540e\u5185\u5b58\u4e0d\u56de\u843d&#xff0c;\u6301\u7eed\u722c\u5347<\/td>\n<td align=\"left\">\u9636\u68af\u72b6&#xff1a;GC \u540e\u56de\u843d&#xff0c;\u4f46\u5cf0\u503c\u4e0d\u65ad\u62ac\u9ad8\u76f4\u81f3\u586b\u6ee1<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">MAT \u5206\u6790\u7ed3\u679c<\/td>\n<td align=\"left\">\u5b58\u5728\u660e\u663e\u7684\u957f\u5f15\u7528\u94fe&#xff0c;\u6307\u5411\u4e0d\u8be5\u5b58\u5728\u7684\u5bf9\u8c61<\/td>\n<td align=\"left\">\u5bf9\u8c61\u5206\u5e03\u5747\u5300&#xff0c;\u65e0\u660e\u663e\u6cc4\u6f0f\u70b9&#xff0c;\u5355\u7eaf\u662f\u4e1a\u52a1\u91cf\u592a\u5927<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u91cd\u542f\u8868\u73b0<\/td>\n<td align=\"left\">\u8fd0\u884c\u4e00\u6bb5\u65f6\u95f4\u540e\u518d\u6b21 OOM<\/td>\n<td align=\"left\">\u91cd\u542f\u540e\u6b63\u5e38&#xff0c;\u6d41\u91cf\u9ad8\u5cf0\u65f6\u590d\u73b0<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u89e3\u51b3\u601d\u8def<\/td>\n<td align=\"left\">\u4fee\u4ee3\u7801&#xff1a;\u5207\u65ad\u5f15\u7528\u94fe<\/td>\n<td align=\"left\">\u8c03\u53c2\u6570\/\u6269\u5bb9&#xff1a;\u589e\u5927 -Xmx \u6216\u4f18\u5316\u7b97\u6cd5<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u2705 \u5224\u65ad\u53e3\u8bc0&#xff1a;<br \/>\n\u201cYoung GC \u540e\u5806\u5185\u5b58\u4e0d\u964d&#xff0c;\u5341\u6709\u516b\u4e5d\u662f\u6cc4\u6f0f&#xff1b;GC \u9891\u7e41\u4e14 CPU \u98d9\u9ad8&#xff0c;\u90a3\u662f GC Overhead\u3002\u201d<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304010200-69a784882b291.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<hr \/>\n<h3>\u4e94\u3001\u9762\u8bd5\u901a\u5173&#xff1a;\u6807\u51c6\u7b54\u6848\u4e0e\u52a0\u5206\u9879<\/h3>\n<h4>&#x1f3af; \u57fa\u7840\u7248\u56de\u7b54 (\u7a33\u8fc7\u7ebf)<\/h4>\n<p>\u9762\u8bd5\u5b98&#xff1a;\u5e38\u89c1\u7684 OOM \u6709\u54ea\u4e9b&#xff1f;\u600e\u4e48\u6392\u67e5&#xff1f;\u5982\u4f55\u907f\u514d Full GC&#xff1f;<\/p>\n<p>\u5019\u9009\u4eba&#xff1a;<br \/>\n\u201c\u5e38\u89c1\u7684 OOM \u4e3b\u8981\u6709\u4e94\u79cd&#xff1a;Java heap space&#xff08;\u5806\u6ee1&#xff09;\u3001GC overhead limit exceeded&#xff08;GC \u6548\u7387\u8fc7\u4f4e&#xff09;\u3001Metaspace&#xff08;\u5143\u7a7a\u95f4\u6ee1&#xff09;\u3001Direct buffer memory&#xff08;\u5806\u5916\u5185\u5b58\u6ee1&#xff09;\u4ee5\u53ca StackOverflowError&#xff08;\u6808\u6ea2\u51fa&#xff09;\u3002<\/p>\n<p>\u6392\u67e5\u6d41\u7a0b\u6211\u901a\u5e38\u5206\u4e09\u6b65&#xff1a;<\/p>\n<li>\u4fdd\u7559\u73b0\u573a&#xff1a;\u4f9d\u9760 -XX:&#043;HeapDumpOnOutOfMemoryError \u83b7\u53d6\u5806\u8f6c\u50a8\u6587\u4ef6\u3002<\/li>\n<li>\u5de5\u5177\u5206\u6790&#xff1a;\u4f7f\u7528 MAT \u6253\u5f00\u6587\u4ef6&#xff0c;\u5148\u770b Histogram \u627e\u5927\u5bf9\u8c61&#xff0c;\u518d\u770b Dominator Tree \u627e\u5185\u5b58\u652f\u914d\u8005&#xff0c;\u6700\u540e\u901a\u8fc7 GC Roots \u94fe\u8def\u5b9a\u4f4d\u5177\u4f53\u7684\u6cc4\u6f0f\u4ee3\u7801&#xff08;\u5982\u672a\u6e05\u7406\u7684 ThreadLocal \u6216\u9759\u6001\u96c6\u5408&#xff09;\u3002<\/li>\n<li>\u4fee\u590d\u9a8c\u8bc1&#xff1a;\u6839\u636e\u5206\u6790\u7ed3\u679c\u4fee\u590d\u4ee3\u7801\u6216\u8c03\u6574\u53c2\u6570&#xff0c;\u5e76\u901a\u8fc7\u538b\u6d4b\u9a8c\u8bc1\u3002<\/li>\n<p>\u907f\u514d Full GC \u7684\u7b56\u7565\u5305\u62ec&#xff1a;<\/p>\n<li>\u53c2\u6570\u8c03\u4f18&#xff1a;\u5408\u7406\u8bbe\u7f6e\u65b0\u751f\u4ee3\u6bd4\u4f8b (-XX:NewRatio) \u548c\u664b\u5347\u9608\u503c&#xff0c;\u4f7f\u7528 G1\/ZGC \u7b49\u5148\u8fdb\u6536\u96c6\u5668\u3002<\/li>\n<li>\u7981\u7528\u663e\u5f0f GC&#xff1a;\u6dfb\u52a0 -XX:&#043;DisableExplicitGC\u3002<\/li>\n<li>\u4ee3\u7801\u4f18\u5316&#xff1a;\u907f\u514d\u5185\u5b58\u6cc4\u6f0f&#xff0c;\u63a7\u5236\u5927\u5bf9\u8c61\u521b\u5efa&#xff0c;\u53ca\u65f6\u91ca\u653e\u65e0\u7528\u8d44\u6e90\u3002\u201d<\/li>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304010200-69a7848851957.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<hr \/>\n<h4>&#x1f680; \u8fdb\u9636\u7248\u56de\u7b54 (\u62ff Offer)<\/h4>\n<p>(\u5728\u57fa\u7840\u7248\u4e4b\u4e0a&#xff0c;\u8865\u5145\u5b9e\u6218\u6df1\u5ea6)<\/p>\n<p>\u201c\u9664\u4e86\u6807\u51c6\u6d41\u7a0b&#xff0c;\u6211\u60f3\u5206\u4eab\u4e24\u4e2a\u5b9e\u6218\u4e2d\u7684\u6df1\u5c42\u601d\u8003&#xff1a;<\/p>\n<p>\u7b2c\u4e00&#xff0c;\u5173\u4e8e\u2018\u5047\u6027\u2019Full GC \u7684\u8bc6\u522b\u3002<br \/>\n\u6709\u4e00\u6b21\u5927\u4fc3\u524d&#xff0c;\u6211\u4eec\u53d1\u73b0\u5806\u5185\u5b58\u53ea\u7528\u5230\u4e86 60% \u5374\u9891\u7e41 Full GC\u3002\u901a\u8fc7 jstat -gcutil \u76d1\u63a7\u53d1\u73b0 Metaspace \u4f7f\u7528\u7387\u9ad8\u8fbe 99%\u3002\u6839\u56e0\u662f Feign &#043; Hystrix \u7ec4\u5408\u4ea7\u751f\u4e86\u5927\u91cf\u7684\u52a8\u6001\u4ee3\u7406\u7c7b\u3002\u8fd9\u79cd\u60c5\u51b5\u4e0b&#xff0c;\u5355\u7eaf\u8c03\u5927\u5806\u5185\u5b58\u65e0\u6548&#xff0c;\u5fc5\u987b\u589e\u5927 -XX:MaxMetaspaceSize \u5e76\u4f18\u5316\u6846\u67b6\u914d\u7f6e\u3002\u8fd9\u63d0\u9192\u6211\u4eec&#xff0c;Full GC \u4e0d\u4e00\u5b9a\u662f\u8001\u5e74\u4ee3\u7684\u95ee\u9898&#xff0c;\u5143\u7a7a\u95f4\u4e5f\u662f\u91cd\u707e\u533a\u3002<\/p>\n<p>\u7b2c\u4e8c&#xff0c;\u5173\u4e8e GC overhead limit exceeded \u7684\u7279\u6b8a\u6027\u3002<br \/>\n\u8fd9\u79cd OOM \u5f80\u5f80\u4f34\u968f\u7740 CPU 100%\u3002\u5b83\u672c\u8d28\u662f JVM \u7684\u81ea\u6211\u4fdd\u62a4&#xff1a;\u2018\u4e0e\u5176\u5361\u6b7b&#xff0c;\u4e0d\u5982\u62a5\u9519\u2019\u3002\u89e3\u51b3\u5b83\u7684\u6838\u5fc3\u4e0d\u662f\u52a0\u5185\u5b58&#xff0c;\u800c\u662f\u51cf\u5c11\u77ed\u751f\u547d\u5468\u671f\u5bf9\u8c61\u7684\u521b\u5efa\u9891\u7387\u3002\u4f8b\u5982&#xff0c;\u907f\u514d\u5728\u5faa\u73af\u5185 new \u5bf9\u8c61&#xff0c;\u6216\u8005\u5728\u6781\u7aef\u573a\u666f\u4e0b\u8c28\u614e\u4f7f\u7528\u5bf9\u8c61\u6c60\u3002<\/p>\n<p>\u6700\u540e&#xff0c;\u6211\u7684\u8fd0\u7ef4\u7406\u5ff5\u662f\u2018\u9632\u60a3\u4e8e\u672a\u7136\u2019\u3002<br \/>\n\u6211\u4eec\u5728\u751f\u4ea7\u73af\u5883\u63a5\u5165\u4e86 Prometheus &#043; Grafana \u76d1\u63a7&#xff0c;\u5bf9 Old Gen \u589e\u957f\u7387\u3001Metaspace \u4f7f\u7528\u7387\u3001Full GC \u9891\u7387 \u8bbe\u7f6e\u659c\u7387\u544a\u8b66\u3002\u901a\u5e38\u5728 OOM \u53d1\u751f\u524d 1 \u5c0f\u65f6\u5c31\u80fd\u53d1\u73b0\u5f02\u5e38\u8d8b\u52bf&#xff0c;\u4ece\u800c\u5728\u4e1a\u52a1\u4f4e\u5cf0\u671f\u8fdb\u884c\u5e73\u6ed1\u91cd\u542f\u6216\u6269\u5bb9&#xff0c;\u5c06\u4e8b\u6545\u627c\u6740\u5728\u6447\u7bee\u91cc\u3002\u201d<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304010200-69a7848876985.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<hr \/>\n<h3>\u516d\u3001\u907f\u5751\u6307\u5357 &amp; \u52a0\u5206\u5de5\u5177\u7bb1<\/h3>\n<h4>\u274c \u5e38\u89c1\u8bef\u533a (\u5343\u4e07\u522b\u8fd9\u4e48\u8bf4)<\/h4>\n<table>\n<tr>\u9519\u8bef\u8bf4\u6cd5\u2705 \u6b63\u786e\u8ba4\u77e5<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u201cOOM \u5c31\u662f\u5185\u5b58\u4e0d\u591f&#xff0c;\u52a0 -Xmx \u5c31\u884c\u201d<\/td>\n<td align=\"left\">\u52a0\u5185\u5b58\u53ef\u80fd\u53ea\u662f\u63a8\u8fdf\u4e86\u5d29\u6e83\u65f6\u95f4&#xff0c;\u6cc4\u6f0f\u4e0d\u4fee&#xff0c;\u8fdf\u65e9\u518d\u7206\u3002<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u201cYoung GC \u8d8a\u591a\u8d8a\u597d\u201d<\/td>\n<td align=\"left\">Young GC \u4e5f\u6709 STW&#xff0c;\u8fc7\u4e8e\u9891\u7e41\u8bf4\u660e\u65b0\u751f\u4ee3\u592a\u5c0f\u6216\u5bf9\u8c61\u5b58\u6d3b\u7387\u592a\u9ad8\u3002<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u201c\u5806\u5185\u5b58\u8d8a\u5927\u8d8a\u597d\u201d<\/td>\n<td align=\"left\">\u5806\u8d8a\u5927&#xff0c;Full GC \u65f6\u7684 STW \u65f6\u95f4\u8d8a\u957f&#xff0c;\u5927\u5806\u5fc5\u987b\u914d G1\/ZGC\u3002<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u201cMAT \u770b\u5230 byte[] \u6700\u591a\u5c31\u662f\u6cc4\u6f0f\u201d<\/td>\n<td align=\"left\">byte[] \u901a\u5e38\u662f\u5e95\u5c42\u5b58\u50a8&#xff0c;\u8981\u770b\u662f\u8c01\u6301\u6709\u8fd9\u4e9b\u6570\u7ec4\u3002<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u201cSystem.gc() \u4e00\u5b9a\u4f1a\u89e6\u53d1 Full GC\u201d<\/td>\n<td align=\"left\">\u53ea\u662f\u5efa\u8bae&#xff0c;JVM \u53ef\u5ffd\u7565&#xff0c;\u4f46\u751f\u4ea7\u73af\u5883\u52a1\u5fc5\u7528 -XX:&#043;DisableExplicitGC \u7981\u6389\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u2705 \u52a0\u5206\u5de5\u5177\u7bb1 (\u5c55\u73b0\u6781\u5ba2\u7cbe\u795e)<\/h4>\n<p>\u5728\u56de\u7b54\u4e2d\u63d0\u53ca\u4ee5\u4e0b\u5de5\u5177\u547d\u4ee4&#xff0c;\u4f1a\u8ba9\u9762\u8bd5\u5b98\u773c\u524d\u4e00\u4eae&#xff1a;<\/p>\n<li>\u5b9e\u65f6\u76d1\u63a7\u795e\u5668 jstat<span class=\"token comment\"># \u6bcf\u79d2\u5237\u65b0\u4e00\u6b21 GC \u72b6\u6001&#xff0c;\u89c2\u5bdf Old \u533a\u548c Meta \u533a\u7684\u589e\u957f\u8d8b\u52bf<\/span><br \/>\njstat <span class=\"token parameter variable\">-gcutil<\/span> <span class=\"token operator\">&lt;<\/span>pid<span class=\"token operator\">&gt;<\/span> <span class=\"token number\">1000<\/span><\/p>\n<\/li>\n<li>\u8f7b\u91cf\u7ea7\u8bca\u65ad jmap<span class=\"token comment\"># \u4e0d Dump \u6587\u4ef6&#xff0c;\u76f4\u63a5\u770b\u5b58\u6d3b\u5bf9\u8c61\u76f4\u65b9\u56fe (\u7ebf\u4e0a\u614e\u7528&#xff0c;\u8f7b\u5fae STW)<\/span><br \/>\njmap <span class=\"token parameter variable\">-histo:live<\/span> <span class=\"token operator\">&lt;<\/span>pid<span class=\"token operator\">&gt;<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">head<\/span> <span class=\"token parameter variable\">-n<\/span> <span class=\"token number\">20<\/span><\/p>\n<\/li>\n<li>\u5806\u5916\u5185\u5b58\u8ffd\u8e2a NMT<span class=\"token comment\"># \u542f\u52a8\u65f6\u5f00\u542f<\/span><br \/>\n<span class=\"token parameter variable\">-XX:NativeMemoryTracking<\/span><span class=\"token operator\">&#061;<\/span>summary<br \/>\n<span class=\"token comment\"># \u8fd0\u884c\u65f6\u67e5\u770b\u5806\u5916\u5185\u5b58\u8be6\u60c5<\/span><br \/>\njcmd <span class=\"token operator\">&lt;<\/span>pid<span class=\"token operator\">&gt;<\/span> VM.native_memory summary<\/p>\n<\/li>\n<li>\u5728\u7ebf\u8bca\u65ad\u795e\u5668 Arthas<span class=\"token comment\"># \u65e0\u9700\u91cd\u542f&#xff0c;\u5728\u7ebf\u751f\u6210 Dump (\u652f\u6301 live \u6a21\u5f0f)<\/span><br \/>\nheapdump <span class=\"token parameter variable\">&#8211;live<\/span> \/tmp\/heap.hprof<\/p>\n<\/li>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304010200-69a784889b7e6.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<hr \/>\n<h3>\u7ed3\u8bed<\/h3>\n<p>\u201c\u4f18\u79c0\u7684\u5de5\u7a0b\u5e08&#xff0c;\u4e0d\u662f\u4e0d\u9047\u5230 OOM&#xff0c;\u800c\u662f\u80fd\u5728 10 \u5206\u949f\u5185\u5b9a\u4f4d\u6839\u56e0&#xff0c;\u5e76\u6784\u5efa\u8d77\u9632\u6b62\u590d\u53d1\u7684\u9632\u7ebf\u3002\u201d<\/p>\n<p>JVM \u8c03\u4f18\u662f\u4e00\u573a\u6c38\u65e0\u6b62\u5883\u7684\u4fee\u884c\u3002<\/p>\n<ul>\n<li>GC \u8c03\u4f18\u7684\u6838\u5fc3&#xff1a;\u8ba9\u77ed\u547d\u5bf9\u8c61\u6b7b\u5728\u65b0\u751f\u4ee3&#xff0c;\u51cf\u5c11\u8fdb\u5165\u8001\u5e74\u4ee3\u7684\u6d41\u91cf\u3002<\/li>\n<li>OOM \u6392\u67e5\u7684\u6838\u5fc3&#xff1a;\u4fdd\u7559\u73b0\u573a&#xff0c;\u987a\u85e4\u6478\u74dc&#xff0c;\u533a\u5206\u201c\u771f\u7f3a\u5185\u5b58\u201d\u4e0e\u201c\u5047\u6027\u6cc4\u6f0f\u201d\u3002<\/li>\n<li>\u6700\u9ad8\u5883\u754c&#xff1a;\u76d1\u63a7\u5148\u884c&#xff0c;\u9884\u6848\u515c\u5e95\u3002\u4e0d\u8981\u7b49\u5230\u7ebf\u4e0a\u6551\u706b&#xff0c;\u8981\u5728\u5f00\u53d1 Review \u548c\u6d4b\u8bd5\u538b\u6d4b\u9636\u6bb5\u5c31\u6d88\u706d\u9690\u60a3\u3002<\/li>\n<\/ul>\n<p>\u8bb0\u4f4f\u8fd9\u53e5\u5fc3\u6cd5&#xff1a;<br \/>\n\u201c\u8c03\u53c2\u6cbb\u6807&#xff0c;\u4ee3\u7801\u6cbb\u672c&#xff1b;\u76d1\u63a7\u5148\u884c&#xff0c;\u9884\u6848\u515c\u5e95\u3002\u201d<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304010200-69a78488c4eaf.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/p>\n<hr \/>\n<p>&#x1f4ac; \u4e92\u52a8\u8bdd\u9898&#xff1a;<br \/>\n\u4f60\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u9047\u5230\u8fc7\u6700\u201c\u8be1\u5f02\u201d\u7684 OOM \u662f\u4ec0\u4e48&#xff1f;\u662f\u67d0\u4e2a\u4e0d\u8d77\u773c\u7684\u9759\u6001\u53d8\u91cf&#xff0c;\u8fd8\u662f\u67d0\u4e2a\u7b2c\u4e09\u65b9\u5e93\u7684\u5751&#xff1f;\u6b22\u8fce\u5728\u8bc4\u8bba\u533a\u5206\u4eab\u4f60\u7684\u201c\u8e29\u5751\u201d\u7ecf\u5386&#xff0c;\u8ba9\u6211\u4eec\u4e00\u8d77\u907f\u96f7&#xff01;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6df1\u5165 JVM \u9762\u8bd5\u7bc7&#xff1a;OOM \u4e0e Full GC \u7684\u7ec8\u6781\u653b\u9632\u6307\u5357\u4f5c\u8005&#xff1a;Weisian<br \/>\n\u53d1\u5e03\u65f6\u95f4&#xff1a;2026\u5e742\u6708&#x1f4cc; \u7cfb\u5217\u5bfc\u8bfb&#xff1a;<br \/>\n\u5728\u4e0a\u4e00\u7bc7\u6587\u7ae0\u300a\u4e0d\u505c\u670d\u52a1\u4fee\u6539 JVM \u53c2\u6570\u300b\u4e2d&#xff0c;\u6211\u4eec\u638c\u63e1\u4e86\u751f\u4ea7\u73af\u5883\u7684\u201c\u5fae\u521b\u624b\u672f\u201d\u6280\u5de7\u3002\u4eca\u5929&#xff0c;\u6211\u4eec\u5c06\u76f4\u9762 Java \u5de5\u7a0b\u5e08\u6700\u6050\u60e7\u7684\u4e24\u4e2a\u5669\u68a6\u2014\u2014OOM (Out of Memory) \u4e0e \u9891\u7e41 Full GC\u3002<br \/>\n\u5728\u9ad8\u5e76\u53d1\u3001\u5927\u6d41\u91cf\u573a\u666f\u4e0b&#xff0c;\u5b83\u4eec\u662f\u538b\u57ae<\/p>\n","protected":false},"author":2,"featured_media":80057,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[8975,8115,426],"topic":[],"class_list":["post-80070","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-full-gc","tag-oom","tag-jvm"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>JVM-26-\u9762\u8bd5\u989812\uff1a\u7cfb\u7edfOOM\u4e0eFull GC\u5e94\u8be5\u600e\u4e48\u529e\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/80070.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"JVM-26-\u9762\u8bd5\u989812\uff1a\u7cfb\u7edfOOM\u4e0eFull GC\u5e94\u8be5\u600e\u4e48\u529e\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6df1\u5165 JVM \u9762\u8bd5\u7bc7&#xff1a;OOM \u4e0e Full GC \u7684\u7ec8\u6781\u653b\u9632\u6307\u5357\u4f5c\u8005&#xff1a;Weisian \u53d1\u5e03\u65f6\u95f4&#xff1a;2026\u5e742\u6708&#x1f4cc; \u7cfb\u5217\u5bfc\u8bfb&#xff1a; \u5728\u4e0a\u4e00\u7bc7\u6587\u7ae0\u300a\u4e0d\u505c\u670d\u52a1\u4fee\u6539 JVM \u53c2\u6570\u300b\u4e2d&#xff0c;\u6211\u4eec\u638c\u63e1\u4e86\u751f\u4ea7\u73af\u5883\u7684\u201c\u5fae\u521b\u624b\u672f\u201d\u6280\u5de7\u3002\u4eca\u5929&#xff0c;\u6211\u4eec\u5c06\u76f4\u9762 Java \u5de5\u7a0b\u5e08\u6700\u6050\u60e7\u7684\u4e24\u4e2a\u5669\u68a6\u2014\u2014OOM (Out of Memory) \u4e0e \u9891\u7e41 Full GC\u3002 \u5728\u9ad8\u5e76\u53d1\u3001\u5927\u6d41\u91cf\u573a\u666f\u4e0b&#xff0c;\u5b83\u4eec\u662f\u538b\u57ae\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/80070.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-03-04T01:02:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304010158-69a78486b3243.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/80070.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/80070.html\",\"name\":\"JVM-26-\u9762\u8bd5\u989812\uff1a\u7cfb\u7edfOOM\u4e0eFull GC\u5e94\u8be5\u600e\u4e48\u529e\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-03-04T01:02:02+00:00\",\"dateModified\":\"2026-03-04T01:02:02+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/80070.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/80070.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/80070.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"JVM--26-\u9762\u8bd5\u989812\uff1a\u7cfb\u7edfOOM\u4e0eFull GC\u5e94\u8be5\u600e\u4e48\u529e\uff1f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"JVM-26-\u9762\u8bd5\u989812\uff1a\u7cfb\u7edfOOM\u4e0eFull GC\u5e94\u8be5\u600e\u4e48\u529e\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/80070.html","og_locale":"zh_CN","og_type":"article","og_title":"JVM-26-\u9762\u8bd5\u989812\uff1a\u7cfb\u7edfOOM\u4e0eFull GC\u5e94\u8be5\u600e\u4e48\u529e\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6df1\u5165 JVM \u9762\u8bd5\u7bc7&#xff1a;OOM \u4e0e Full GC \u7684\u7ec8\u6781\u653b\u9632\u6307\u5357\u4f5c\u8005&#xff1a;Weisian \u53d1\u5e03\u65f6\u95f4&#xff1a;2026\u5e742\u6708&#x1f4cc; \u7cfb\u5217\u5bfc\u8bfb&#xff1a; \u5728\u4e0a\u4e00\u7bc7\u6587\u7ae0\u300a\u4e0d\u505c\u670d\u52a1\u4fee\u6539 JVM \u53c2\u6570\u300b\u4e2d&#xff0c;\u6211\u4eec\u638c\u63e1\u4e86\u751f\u4ea7\u73af\u5883\u7684\u201c\u5fae\u521b\u624b\u672f\u201d\u6280\u5de7\u3002\u4eca\u5929&#xff0c;\u6211\u4eec\u5c06\u76f4\u9762 Java \u5de5\u7a0b\u5e08\u6700\u6050\u60e7\u7684\u4e24\u4e2a\u5669\u68a6\u2014\u2014OOM (Out of Memory) \u4e0e \u9891\u7e41 Full GC\u3002 \u5728\u9ad8\u5e76\u53d1\u3001\u5927\u6d41\u91cf\u573a\u666f\u4e0b&#xff0c;\u5b83\u4eec\u662f\u538b\u57ae","og_url":"https:\/\/www.wsisp.com\/helps\/80070.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-03-04T01:02:02+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/03\/20260304010158-69a78486b3243.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/80070.html","url":"https:\/\/www.wsisp.com\/helps\/80070.html","name":"JVM-26-\u9762\u8bd5\u989812\uff1a\u7cfb\u7edfOOM\u4e0eFull GC\u5e94\u8be5\u600e\u4e48\u529e\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-03-04T01:02:02+00:00","dateModified":"2026-03-04T01:02:02+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/80070.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/80070.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/80070.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"JVM--26-\u9762\u8bd5\u989812\uff1a\u7cfb\u7edfOOM\u4e0eFull GC\u5e94\u8be5\u600e\u4e48\u529e\uff1f"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/80070","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=80070"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/80070\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/80057"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=80070"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=80070"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=80070"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=80070"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}