{"id":26220,"date":"2011-11-05T20:41:47","date_gmt":"2011-11-05T12:41:47","guid":{"rendered":"http:\/\/www.yankay.com\/?p=26220"},"modified":"2011-11-05T20:41:47","modified_gmt":"2011-11-05T12:41:47","slug":"%e5%a4%9a%e6%a0%b8%e5%b9%b3%e5%8f%b0%e4%b8%8b%e7%9a%84java%e4%bc%98%e5%8c%96","status":"publish","type":"post","link":"http:\/\/yankay.com\/%e5%a4%9a%e6%a0%b8%e5%b9%b3%e5%8f%b0%e4%b8%8b%e7%9a%84java%e4%bc%98%e5%8c%96\/","title":{"rendered":"\u591a\u6838\u5e73\u53f0\u4e0b\u7684JAVA\u4f18\u5316"},"content":{"rendered":"
\u73b0\u5728\u591a\u6838CPU\u662f\u4e3b\u6d41\u3002\u5229\u7528\u591a\u6838\u6280\u672f\uff0c\u53ef\u4ee5\u6709\u6548\u53d1\u6325\u786c\u4ef6\u7684\u80fd\u529b\uff0c\u63d0\u5347\u541e\u5410\u91cf\uff0c\u5bf9\u4e8eJava\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5e76\u53d1\u5783\u573e\u6536\u96c6\u3002\u4f46\u662fJava\u5229\u7528\u591a\u6838\u6280\u672f\u4e5f\u5e26\u6765\u4e86\u4e00\u4e9b\u95ee\u9898\uff0c\u4e3b\u8981\u662f\u591a\u7ebf\u7a0b\u5171\u4eab\u5185\u5b58\u5f15\u8d77\u4e86\u3002\u76ee\u524d\u5185\u5b58\u548cCPU\u4e4b\u95f4\u7684\u5e26\u5bbd\u662f\u4e00\u4e2a\u4e3b\u8981\u74f6\u9888\uff0c\u6bcf\u4e2a\u6838\u53ef\u4ee5\u72ec\u4eab\u4e00\u90e8\u5206\u9ad8\u901f\u7f13\u5b58\uff0c\u53ef\u4ee5\u63d0\u9ad8\u6027\u80fd\u3002JVM\u662f\u5229\u7528\u64cd\u4f5c\u7cfb\u7edf\u7684”\u8f7b\u91cf\u7ea7\u8fdb\u7a0b”\u5b9e\u73b0\u7ebf\u7a0b\uff0c\u6240\u4ee5\u7ebf\u7a0b\u6bcf\u64cd\u4f5c\u4e00\u6b21\u5171\u4eab\u5185\u5b58\uff0c\u90fd\u65e0\u6cd5\u5728\u9ad8\u901f\u7f13\u5b58\u4e2d\u547d\u4e2d\uff0c\u662f\u4e00\u6b21\u5f00\u9500\u8f83\u5927\u7684\u7cfb\u7edf\u8c03\u7528\u3002\u6240\u4ee5\u533a\u522b\u4e8e\u666e\u901a\u7684\u4f18\u5316\uff0c\u9488\u5bf9\u591a\u6838\u5e73\u53f0\uff0c\u9700\u8981\u8fdb\u884c\u4e00\u4e9b\u7279\u6b8a\u7684\u4f18\u5316\u3002<\/p>\n
\u7ebf\u7a0b\u6570\u8981\u5927\u4e8e\u7b49\u4e8e\u6838\u6570<\/strong><\/p>\n \u5982\u679c\u4f7f\u7528\u591a\u7ebf\u7a0b\uff0c\u53ea\u6709\u8fd0\u884c\u7684\u7ebf\u7a0b\u6570\u6bd4\u6838\u6570\u5927\uff0c\u624d\u6709\u53ef\u80fd\u69a8\u5e72CPU\u8d44\u6e90\uff0c\u5426\u5219\u4f1a\u6709\u82e5\u5e72\u6838\u95f2\u7f6e\u3002\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5982\u679c\u7ebf\u7a0b\u6570\u76ee\u592a\u591a\uff0c\u5c31\u4f1a\u5360\u7528\u8fc7\u591a\u5185\u5b58\uff0c\u5bfc\u81f4\u6027\u80fd\u4e0d\u5347\u53cd\u964d\u3002JVM\u7684\u5783\u573e\u56de\u6536\u4e5f\u662f\u9700\u8981\u7ebf\u7a0b\u7684\uff0c\u6240\u4ee5\u8fd9\u91cc\u7684\u7ebf\u7a0b\u6570\u5305\u542bJVM\u81ea\u5df1\u7684\u7ebf\u7a0b<\/p>\n \u5c3d\u91cf\u51cf\u5c11\u5171\u4eab\u6570\u636e\u5199\u64cd\u4f5c<\/strong><\/p>\n \u6bcf\u4e2a\u7ebf\u7a0b\u6709\u81ea\u5df1\u7684\u5de5\u4f5c\u5185\u5b58\uff0c\u5728\u8fd9\u4e2a\u533a\u57df\u5185\uff0c\u7cfb\u7edf\u53ef\u4ee5\u6beb\u65e0\u987e\u5fcc\u7684\u4f18\u5316\uff0c\u5982\u679c\u53bb\u8bfb\u5171\u4eab\u5185\u5b58\u533a\u57df\uff0c\u6027\u80fd\u4e5f\u4e0d\u4f1a\u4e0b\u964d\u3002\u4f46\u662f\u4e00\u65e6\u7ebf\u7a0b\u60f3\u5199\u5171\u4eab\u5185\u5b58(\u4f7f\u7528volatile\u5173\u952e\u5b57)\uff0c\u5c31\u4f1a\u63d2\u5165\u5f88\u591a\u5185\u5b58\u5c4f\u969c\u64cd\u4f5c(Memory Barrier\u6216\u8005Memory Fence)\u6307\u4ee4\uff0c\u4fdd\u8bc1\u5904\u7406\u5668\u4e0d\u4e71\u5e8f\u6267\u884c\u3002\u76f8\u6bd4\u5199\u672c\u5730\u7ebf\u7a0b\u81ea\u6709\u7684\u53d8\u91cf\uff0c\u6027\u80fd\u4e0b\u964d\u5f88\u591a\u3002\u5904\u7406\u65b9\u6cd5\u662f\u5c3d\u91cf\u51cf\u5c11\u5171\u4eab\u6570\u636e\uff0c\u8fd9\u6837\u4e5f\u7b26\u5408”\u6570\u636e\u8026\u5408”\u7684\u8bbe\u8ba1\u539f\u5219\u3002<\/p>\n \u4f7f\u7528synchronize\u5173\u952e\u5b57<\/strong><\/p>\n \u5728Java1.5\u4e2d\uff0csynchronize\u662f\u6027\u80fd\u4f4e\u6548\u7684\u3002\u56e0\u4e3a\u8fd9\u662f\u4e00\u4e2a\u91cd\u91cf\u7ea7\u64cd\u4f5c\uff0c\u9700\u8981\u8c03\u7528\u64cd\u4f5c\u63a5\u53e3\uff0c\u5bfc\u81f4\u6709\u53ef\u80fd\u52a0\u9501\u6d88\u8017\u7684\u7cfb\u7edf\u65f6\u95f4\u6bd4\u52a0\u9501\u4ee5\u5916\u7684\u64cd\u4f5c\u8fd8\u591a\u3002\u76f8\u6bd4\u4e4b\u4e0b\u4f7f\u7528Java\u63d0\u4f9b\u7684Lock\u5bf9\u8c61\uff0c\u6027\u80fd\u66f4\u9ad8\u4e00\u4e9b\u3002\u4f46\u662f\u5230\u4e86Java1.6\uff0c\u53d1\u751f\u4e86\u53d8\u5316\u3002synchronize\u5728\u8bed\u4e49\u4e0a\u5f88\u6e05\u6670\uff0c\u53ef\u4ee5\u8fdb\u884c\u5f88\u591a\u4f18\u5316\uff0c\u6709\u9002\u5e94\u81ea\u65cb\uff0c\u9501\u6d88\u9664\uff0c\u9501\u7c97\u5316\uff0c\u8f7b\u91cf\u7ea7\u9501\uff0c\u504f\u5411\u9501\u7b49\u7b49\u3002\u5bfc\u81f4\u5728Java1.6\u4e0asynchronize\u7684\u6027\u80fd\u5e76\u4e0d\u6bd4Lock\u5dee\u3002\u5b98\u65b9\u4e5f\u8868\u793a\uff0c\u4ed6\u4eec\u4e5f\u66f4\u652f\u6301synchronize\uff0c\u5728\u672a\u6765\u7684\u7248\u672c\u4e2d\u8fd8\u6709\u4f18\u5316\u4f59\u5730\u3002<\/p>\n \u4f7f\u7528\u4e50\u89c2\u7b56\u7565<\/strong><\/p>\n \u4f20\u7edf\u7684\u540c\u6b65\u5e76\u53d1\u7b56\u7565\u662f\u60b2\u89c2\u7684\u3002\u8868\u73b0\u8bed\u4e49\u4e3a\uff1a\u591a\u7ebf\u7a0b\u64cd\u4f5c\u4e00\u4e2a\u5bf9\u8c61\u7684\u65f6\u5019\uff0c\u603b\u89c9\u5f97\u4f1a\u6709\u4e24\u4e2a\u7ebf\u7a0b\u5728\u540c\u65f6\u64cd\u4f5c\uff0c\u6240\u4ee5\u9700\u8981\u9501\u8d77\u6765\u3002\u4e50\u89c2\u7b56\u7565\u662f\uff0c\u5047\u8bbe\u5e73\u65f6\u5c31\u4e00\u4e2a\u7ebf\u7a0b\u8bbf\u95ee\uff0c\u5f53\u51fa\u73b0\u4e86\u51b2\u7a81\u7684\u65f6\u5019\uff0c\u518d\u91cd\u8bd5\u3002\u8fd9\u6837\u66f4\u9ad8\u6548\u4e00\u4e9b\u3002Java\u7684AtomicInteger\u5c31\u662f\u4f7f\u7528\u4e86\u8fd9\u4e2a\u7b56\u7565\u3002<\/p>\n \u4f7f\u7528\u7ebf\u7a0b\u672c\u5730\u53d8\u91cf(ThreadLocal)<\/strong><\/p>\n \u4f7f\u7528ThreadLocal\u53ef\u4ee5\u751f\u6210\u7ebf\u7a0b\u672c\u5730\u5bf9\u8c61\u7684\u526f\u672c\uff0c\u4e0d\u4f1a\u548c\u5176\u4ed6\u7ebf\u7a0b\u5171\u4eab\u3002\u5f53\u8be5\u7ebf\u7a0b\u7ec8\u6b62\u7684\u65f6\u5019\uff0c\u5176\u672c\u5730\u53d8\u91cf\u53ef\u4ee5\u5168\u90e8\u56de\u6536\u3002<\/p>\n \u7c7b\u4e2dField\u7684\u6392\u5e8f<\/strong><\/p>\n \u53ef\u4ee5\u5c06\u4e00\u4e2a\u7c7b\u4f1a\u9891\u7e41\u8bbf\u95ee\u5230\u7684\u51e0\u4e2afield\u653e\u5728\u4e00\u8d77\uff0c\u8fd9\u6837\u4ed6\u4eec\u5c31\u6709\u66f4\u591a\u7684\u53ef\u80fd\u6027\u88ab\u4e00\u8d77\u52a0\u5165\u9ad8\u901f\u7f13\u5b58\u3002\u540c\u65f6\u6700\u597d\u628a\u4ed6\u4eec\u653e\u5728\u5934\u90e8\u3002\u57fa\u672c\u53d8\u91cf\u548c\u5f15\u7528\u53d8\u91cf\u4e0d\u8981\u4ea4\u9519\u6392\u653e\u3002<\/p>\n \u6279\u91cf\u5904\u7406\u6570\u7ec4<\/strong><\/p>\n \u73b0\u5728\u5904\u7406\u5668\u53ef\u4ee5\u7528\u4e00\u6761\u6307\u4ee4\u6765\u5904\u7406\u4e00\u4e2a\u6570\u7ec4\u4e2d\u7684\u591a\u6761\u8bb0\u5f55\uff0c\u4f8b\u5982\u53ef\u4ee5\u540c\u65f6\u5411\u4e00\u4e2abyte\u6570\u7ec4\u4e2d\u8bfb\u6216\u8005\u5199store\u8bb0\u5f55\u3002\u6240\u4ee5\u8981\u5c3d\u91cf\u4f7f\u7528System.arraycopy()\u8fd9\u6837\u7684\u6279\u91cf\u63a5\u53e3\uff0c\u800c\u4e0d\u662f\u81ea\u5df1\u64cd\u4f5c\u6570\u7ec4\u3002<\/p>\n \u542f\u7528\u5927\u5185\u5b58\u9875<\/strong><\/p>\n \u73b0\u5728\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u9ed8\u8ba4\u9875\u662f4K\u3002\u5982\u679c\u4f60\u7684heap\u662f4GB\uff0c\u5c31\u610f\u5473\u7740\u8981\u6267\u884c1024*1024\u6b21\u5206\u914d\u64cd\u4f5c\u3002\u6240\u4ee5\u6700\u597d\u80fd\u628a\u9875\u8c03\u5927\u3002\u8fd9\u4e2a\u914d\u989d\u8bbe\u8ba1\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5355\u6539Jvm\u662f\u4e0d\u884c\u7684\u3002Linux\u4e0a\u7684\u914d\u7f6e\u6709\u70b9\u590d\u6742\uff0c\u4e0d\u8be6\u8ff0\u3002<\/p>\n \u5728Java1.6\u4e2dUseLargePages\u662f\u9ed8\u8ba4\u5f00\u542f\u7684\uff0cLasrgePageSzieInBytes\u88ab\u8bbe\u7f6e\u6210\u4e864M\u3002\u7b14\u8005\u770b\u5230\u4e00\u4e9b\u60c5\u51b5\u4e0b\u914d\u7f6e\u6210\u4e86128MB\uff0c\u5728\u5b98\u65b9\u7684\u6027\u80fd\u6d4b\u8bd5\u4e2d\u66f4\u662f\u914d\u7f6e\u5230256MB\u3002<\/p>\n \u542f\u7528\u538b\u7f29\u6307\u9488<\/strong><\/p>\n Java\u768464\u7684\u6027\u80fd\u6bd432\u6162\uff0c\u539f\u56e0\u662f\u56e0\u4e3a\u5176\u6307\u9488\u753132\u4f4d\u6269\u5c55\u523064\u4f4d\uff0c\u867d\u7136\u5bfb\u5740\u7a7a\u95f4\u4ece4GB\u6269\u5927\u5230256 TB\uff0c\u4f46\u5bfc\u81f4\u6027\u80fd\u7684\u4e0b\u964d\uff0c\u5e76\u5360\u7528\u4e86\u66f4\u591a\u7684\u5185\u5b58\u3002\u6240\u4ee5\u5bf9\u6307\u9488\u8fdb\u884c\u538b\u7f29\u3002\u538b\u7f29\u540e\u7684\u6307\u9488\u6700\u591a\u652f\u630132GB\u5185\u5b58\uff0c\u5e76\u4e14\u53ef\u4ee5\u83b7\u5f9732\u4f4dJVM\u7684\u6027\u80fd\u3002<\/p>\n \u5728JDK6 update 23\u9ed8\u8ba4\u5f00\u542f\u4e86\uff0c\u4e4b\u524d\u7684\u7248\u672c\u53ef\u4ee5\u4f7f\u7528-XX:+UseCompressedOops\u6765\u542f\u52a8\u914d\u7f6e\u3002<\/p>\n \u6027\u80fd\u53ef\u4ee5\u770b\u8fd9\u4e2a\u8bc4\u6d4b<\/a>\uff0c\u6027\u80fd\u7684\u63d0\u5347\u662f\u5f88\u53ef\u89c2\u3002 numa\u662f\u4e00\u4e2aCPU\u7684\u7279\u6027\u3002SMP\u67b6\u6784\u4e0b\uff0cCPU\u7684\u6838\u662f\u5bf9\u79f0\uff0c\u4f46\u662f\u4ed6\u4eec\u5171\u4eab\u4e00\u6761\u7cfb\u7edf\u603b\u7ebf\u3002\u6240\u4ee5CPU\u591a\u4e86\uff0c\u603b\u7ebf\u5c31\u4f1a\u6210\u4e3a\u74f6\u9888\u3002\u5728NUMA\u67b6\u6784\u4e0b\uff0c\u82e5\u5e72CPU\u7ec4\u6210\u4e00\u4e2a\u7ec4\uff0c\u7ec4\u4e4b\u95f4\u6709\u70b9\u5bf9\u70b9\u7684\u901a\u8baf\uff0c\u76f8\u4e92\u72ec\u7acb\u3002\u542f\u52a8\u5b83\u53ef\u4ee5\u63d0\u9ad8\u6027\u80fd\u3002<\/p>\n NUMA\u9700\u8981\u786c\u4ef6\uff0c\u64cd\u4f5c\u7cfb\u7edf\uff0cJVM\u540c\u65f6\u542f\u7528\uff0c\u624d\u80fd\u542f\u7528\u3002Linux\u53ef\u4ee5\u7528numactl<\/a>\u6765\u914d\u7f6enuma,JVM\u901a\u8fc7-XX:+UseNUMA\u6765\u542f\u7528\u3002<\/p>\n \u6fc0\u8fdb\u4f18\u5316\u7279\u6027<\/strong><\/p>\n \u5728Java1.6\u4e2d\uff0c\u6fc0\u8fdb\u4f18\u5316(AggressiveOpts)\u662f\u9ed8\u8ba4\u5f00\u542f\u7684\u3002\u6fc0\u8fdb\u4f18\u5316\u662f\u4e00\u822c\u6709\u4e00\u4e9b\u4e0b\u4e00\u4e2a\u7248\u672c\u624d\u4f1a\u53d1\u5e03\u7684\u4f18\u5316\u9009\u9879\u3002\u4f46\u662f\u6709\u53ef\u80fd\u9020\u6210\u4e0d\u7a33\u5b9a\u3002\u524d\u6bb5\u65f6\u95f4\u4ee5\u8bb9\u4f20\u8bb9\u7684JDK7\u7684Bug<\/a>\uff0c\u5c31\u662f\u5f00\u542f\u8fd9\u4e2a\u9009\u9879\u540e\u6d4b\u5230\u7684\u3002<\/p>\n \u9003\u9038\u5206\u6790<\/strong><\/p>\n \u8ba9\u4e00\u4e2a\u5bf9\u8c61\u5728\u4e00\u4e2a\u65b9\u6cd5\u5185\u521b\u5efa\u540e\uff0c\u5982\u679c\u4ed6\u4f20\u9012\u51fa\u53bb\uff0c\u5c31\u53ef\u4ee5\u79f0\u4e3a\u65b9\u6cd5\u9003\u9038\uff1b\u5982\u679c\u4f20\u9012\u5230\u522b\u7684\u7ebf\u7a0b\uff0c\u6210\u4e3a\u7ebf\u7a0b\u9003\u9038\u3002\u5982\u679c\u80fd\u77e5\u9053\u4e00\u4e2a\u5bf9\u8c61\u6ca1\u6709\u9003\u9038\uff0c\u5c31\u53ef\u4ee5\u628a\u5b83\u5206\u914d\u5728\u6808\u800c\u4e0d\u662f\u5806\u4e0a\uff0c\u8282\u7ea6GC\u7684\u65f6\u95f4\u3002\u540c\u65f6\u53ef\u4ee5\u5c06\u8fd9\u4e2a\u5bf9\u8c61\u62c6\u6563\uff0c\u76f4\u63a5\u4f7f\u7528\u5176\u6210\u5458\u53d8\u91cf\uff0c\u6709\u5229\u4e8e\u5229\u7528\u9ad8\u901f\u7f13\u5b58\u3002\u5982\u679c\u4e00\u4e2a\u5bf9\u8c61\u6ca1\u6709\u7ebf\u7a0b\u9003\u9038\uff0c\u5c31\u53ef\u4ee5\u53d6\u6d88\u5176\u4e2d\u4e00\u5207\u540c\u6b65\u64cd\u4f5c\uff0c\u5f88\u5927\u7684\u63d0\u9ad8\u6027\u80fd\u3002<\/p>\n \u4f46\u662f\u9003\u9038\u5206\u6790\u662f\u5f88\u6709\u96be\u5ea6\u7684\uff0c\u56e0\u4e3a\u82b1\u4e86cpu\u53bb\u5bf9\u4e00\u4e2a\u5bf9\u8c61\u53bb\u5206\u6790\uff0c\u8981\u662f\u4ed6\u4e0d\u9003\u9038\uff0c\u5c31\u65e0\u6cd5\u4f18\u5316\uff0c\u4e4b\u524d\u7684\u5206\u6790\u8840\u672c\u65e0\u5f52\u3002\u6240\u4ee5\u4e0d\u80fd\u4f7f\u7528\u590d\u6742\u7684\u7b97\u6cd5\uff0c\u540c\u65f6\u73b0\u5728\u7684JVM\u4e5f\u6ca1\u6709\u5b9e\u73b0\u6808\u4e0a\u5206\u914d\u3002\u6240\u4ee5\u5f00\u542f\u4e4b\u540e\uff0c\u6027\u80fd\u4e5f\u53ef\u80fd\u4e0b\u964d\u3002<\/p>\n \u53ef\u4ee5\u4f7f\u7528-XX:+DoEscapeAnalysis\u6765\u5f00\u542f\u9003\u9038\u5206\u6790\u3002<\/p>\n \u9ad8\u541e\u5410\u91cfGC\u914d\u7f6e<\/strong><\/p>\n <\/strong>\u5bf9\u4e8e\u9ad8\u541e\u5410\u91cf\uff0c\u5728\u5e74\u8f7b\u6001\u53ef\u4ee5\u4f7f\u7528Parallel Scavenge,\u5e74\u8001\u6001\u53ef\u4ee5\u4f7f\u7528Parallel Old\u5783\u573e\u6536\u96c6\u5668\u3002 \u53ef\u4ee5\u5c06-XX:ParallelGCThreads\u6839\u636eCPU\u7684\u4e2a\u6570\u8fdb\u884c\u8c03\u6574\u3002\u53ef\u4ee5\u662fCPU\u6570\u76841\/2\u6216\u80055\/8<\/p>\n \u4f4e\u5ef6\u8fdfGC\u914d\u7f6e<\/strong><\/p>\n <\/strong>\u5bf9\u4e8e\u4f4e\u5ef6\u8fdf\u7684\u5e94\u7528\uff0c\u5728\u5e74\u8f7b\u6001\u53ef\u4ee5\u4f7f\u7528ParNew,\u5e74\u8001\u6001\u53ef\u4ee5\u4f7f\u7528CMS\u5783\u573e\u6536\u96c6\u5668\u3002<\/p>\n \u53ef\u4ee5\u4f7f\u7528-XX:+UseConcMarkSweepGC\u548c-XX:+UseParNewGC\u6253\u5f00\u3002<\/p>\n \u53ef\u4ee5\u5c06-XX:ParallelGCThreads\u6839\u636eCPU\u7684\u4e2a\u6570\u8fdb\u884c\u8c03\u6574\u3002\u53ef\u4ee5\u662fCPU\u6570\u76841\/2\u6216\u80055\/8<\/p>\n \u53ef\u4ee5\u8c03\u6574-XX:MaxTenuringThreshold(\u664b\u5347\u5e74\u8001\u4ee3\u5e74\u9f84)\u8c03\u9ad8\uff0c\u9ed8\u8ba4\u662f15.\u8fd9\u6837\u53ef\u4ee5\u51cf\u5c11\u5e74\u8001\u4ee3GC\u7684\u538b\u529b<\/p>\n \u53ef\u4ee5-XX:TargetSurvivorRatio\uff0c\u8c03\u6574Survivor\u7684\u5360\u7528\u6bd4\u7387\u3002\u9ed8\u8ba450%.\u8c03\u9ad8\u53ef\u4ee5\u63d0\u4f9bSurvivor\u533a\u7684\u5229\u7528\u7387<\/p>\n \u53ef\u4ee5\u8c03\u6574-XX:SurvivorRatio,\u8c03\u6574Eden\u548cSurvivor\u7684\u6bd4\u91cd\u3002\u9ed8\u8ba4\u662f8\u3002\u8fd9\u4e2a\u6bd4\u91cd\u8d8a\u5c0f\uff0cSurvivor\u8d8a\u5927\uff0c\u5bf9\u8c61\u53ef\u4ee5\u5728\u5e74\u8f7b\u6001\u5446\u66f4\u591a\u65f6\u95f4\u3002<\/p>\n \u7b49\u7b49<\/p>\n <\/p>\n \u53c2\u89c1\uff1a\u300aJava\u4f18\u5316\u767d\u76ae\u4e66<\/a>\u300b\uff0c\u300a\u6df1\u5165\u7406\u89e3Java\u865a\u62df\u673a<\/a>\u300b<\/p>\n","protected":false},"excerpt":{"rendered":" \u73b0\u5728\u591a\u6838CPU\u662f\u4e3b\u6d41\u3002\u5229\u7528\u591a\u6838\u6280\u672f\uff0c\u53ef\u4ee5\u6709\u6548\u53d1\u6325\u786c\u4ef6\u7684\u80fd\u529b\uff0c\u63d0\u5347\u541e\u5410\u91cf\uff0c\u5bf9\u4e8eJava\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5e76\u53d1\u5783\u573e\u6536\u96c6\u3002\u4f46\u662fJava\u5229\u7528\u591a\u6838\u6280\u672f\u4e5f\u5e26\u6765\u4e86\u4e00\u4e9b\u95ee\u9898\uff0c\u4e3b\u8981\u662f\u591a\u7ebf\u7a0b\u5171\u4eab\u5185\u5b58\u5f15\u8d77\u4e86\u3002\u76ee\u524d\u5185\u5b58\u548cCPU\u4e4b\u95f4\u7684\u5e26\u5bbd\u662f\u4e00\u4e2a\u4e3b\u8981\u74f6\u9888\uff0c\u6bcf\u4e2a\u6838\u53ef\u4ee5\u72ec\u4eab\u4e00\u90e8\u5206\u9ad8\u901f\u7f13\u5b58\uff0c\u53ef\u4ee5\u63d0\u9ad8\u6027\u80fd\u3002JVM\u662f\u5229\u7528\u64cd\u4f5c\u7cfb\u7edf\u7684”\u8f7b\u91cf\u7ea7\u8fdb\u7a0b”\u5b9e\u73b0\u7ebf\u7a0b\uff0c\u6240\u4ee5\u7ebf\u7a0b\u6bcf\u64cd\u4f5c\u4e00\u6b21\u5171\u4eab\u5185\u5b58\uff0c\u90fd\u65e0\u6cd5\u5728\u9ad8\u901f\u7f13\u5b58\u4e2d\u547d\u4e2d\uff0c\u662f\u4e00\u6b21\u5f00\u9500\u8f83\u5927\u7684\u7cfb\u7edf\u8c03\u7528\u3002\u6240\u4ee5\u533a\u522b\u4e8e\u666e\u901a\u7684\u4f18\u5316\uff0c\u9488\u5bf9\u591a\u6838\u5e73\u53f0\uff0c\u9700\u8981\u8fdb\u884c\u4e00\u4e9b\u7279\u6b8a\u7684\u4f18\u5316\u3002<\/p>\nJVM\u4f18\u5316<\/h3>\n
\n
\n
\n<\/a>
\n\u542f\u7528NUMA<\/strong><\/p>\n
\n\u4f7f\u7528-XX:+UseParallelOldGC\u5f00\u542f<\/p>\n