{"id":111415,"date":"2024-12-13T07:09:10","date_gmt":"2024-12-12T23:09:10","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=111415"},"modified":"2024-12-13T07:09:10","modified_gmt":"2024-12-12T23:09:10","slug":"jdk11-reduce-delay","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/jdk11-reduce-delay.html","title":{"rendered":"JDK11\u5c06\u65b0\u589e\u5927\u5e45\u964d\u4f4eGC\u5ef6\u8fdf\u7684ZGC\u529f\u80fd"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u4e4b\u524d\u6211\u4eec\u62a5\u5bfc\u8fc7JDK 11 \u8fdb\u5165\u7279\u6027\u51bb\u7ed3\u9636\u6bb5\uff0c\u4eca\u5929\u6765\u770b\u770bJEP 333\u4e3a\u4e86\u5927\u5e45\u51cf\u5c11 GC \u6682\u505c\u65f6\u95f4\u7684\u53ef\u4f38\u7f29\u4f4e\u5ef6\u8fdf\u5783\u573e\u56de\u6536\u5668 ZGC\uff08Scalable Low-Latency Garbage Collector\u00a0\uff09\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

GC \u4e00\u76f4\u4ee5\u6765\u662f Java \u7684\u4e3b\u8981\u4f18\u52bf\u4e4b\u4e00\uff0c\u4f46\u662f\uff0c\u5f53\u5783\u573e\u56de\u6536\u6682\u505c\u65f6\u95f4\u8fc7\u957f\u65f6\uff0c\u4f1a\u5bf9\u5e94\u7528\u7a0b\u5e8f\u7684\u54cd\u5e94\u65f6\u95f4\u4ea7\u751f\u8d1f\u9762\u5f71\u54cd\uff0c\u800c\u73b0\u4ee3\u7cfb\u7edf\u4e2d\u53ef\u7528\u7684\u5185\u5b58\u91cf\u4e0d\u65ad\u589e\u957f\uff0c\u7528\u6237\u548c\u5e94\u7528\u5f00\u53d1\u4eba\u5458\u5e0c\u671b JVM \u80fd\u591f\u4ee5\u9ad8\u6548\u7684\u65b9\u5f0f\u5145\u5206\u5229\u7528\u6b64\u5185\u5b58\uff0c\u5e76\u4e14\u4e0d\u8981\u6709\u8fc7\u957f\u7684 GC \u6682\u505c\u65f6\u95f4\u3002\u6b64\u6b21\u5c06\u65b0\u589e\u7684 ZGC \u529f\u80fd\uff0c\u80fd\u591f\u6d88\u9664\u6216\u5927\u5e45\u7f29\u77ed GC \u6682\u505c\u7684\u65f6\u95f4\u3002<\/p>\n

ZGC \u6709\u4ee5\u4e0b\u51e0\u4e2a\u76ee\u6807\uff1a
\n(1)GC \u6682\u505c\u65f6\u95f4\u4e0d\u5e94\u8d85\u8fc7 10 ms
\n(2)\u5904\u7406\u5806\u7684\u5927\u5c0f\u8303\u56f4\u4ece\u76f8\u5bf9\u8f83\u5c0f\uff08\u51e0\u767e M\uff09\u5230\u975e\u5e38\u5927\uff08\u51e0 T\uff09\u4e0d\u7b49
\n(3)\u4e0e\u4f7f\u7528 G1 \u76f8\u6bd4\uff0c\u5e94\u7528\u7a0b\u5e8f\u541e\u5410\u91cf\u51cf\u5c11\u4e0d\u8d85\u8fc7 15\uff05
\n(4)\u4e3a\u672a\u6765\u7684 GC \u529f\u80fd\u548c\u4f18\u5316\u5229\u7528\u6709\u8272\u6307\u9488\uff08colored pointers\uff09\u548c\u52a0\u8f7d\u5c4f\u969c\uff08load barriers\uff09\u5960\u5b9a\u57fa\u7840
\n(5)\u521d\u59cb\u652f\u6301\u5e73\u53f0\uff1aLinux\/x64<\/p>\n

ZGC \u662f\u4e00\u4e2a\u5e76\u53d1\u7684\u3001\u5355\u4ee3\u7684\u3001\u57fa\u4e8e\u533a\u57df\u7684\u3001NUMA \u611f\u77e5\u7684\u538b\u7f29\u6536\u96c6\u5668\uff0cStop-the-world \u9636\u6bb5\u4ec5\u9650\u4e8e\u6839\u626b\u63cf\uff0c\u56e0\u6b64 GC \u6682\u505c\u65f6\u95f4\u4e0d\u4f1a\u968f\u5806\u6216\u6d3b\u52a8\u96c6\uff08live set\uff09\u7684\u53d8\u5927\u800c\u589e\u52a0\u3002<\/p>\n

ZGC \u7684\u6838\u5fc3\u8bbe\u8ba1\u539f\u5219\/\u9009\u62e9\u662f\u5c06\u52a0\u8f7d\u5c4f\u969c\u4e0e\u6709\u8272\u5bf9\u8c61\u6307\u9488\uff08colored oops\uff09\u7ed3\u5408\u4f7f\u7528\uff0c\u8fd9\u4f7f\u5f97 ZGC \u80fd\u591f\u5728 Java \u5e94\u7528\u7a0b\u5e8f\u7ebf\u7a0b\u8fd0\u884c\u65f6\u6267\u884c\u5e76\u53d1\u64cd\u4f5c\uff0c\u4f8b\u5982\u5bf9\u8c61\u91cd\u5b9a\u5411\u3002\u4ece Java \u7ebf\u7a0b\u7684\u89d2\u5ea6\u6765\u770b\uff0c\u5728 Java \u5bf9\u8c61\u4e2d\u52a0\u8f7d\u5f15\u7528\u5b57\u6bb5\u7684\u884c\u4e3a\u53d7\u5230\u52a0\u8f7d\u5c4f\u969c\u7684\u5f71\u54cd\u3002\u9664\u4e86\u5bf9\u8c61\u5730\u5740\u4e4b\u5916\uff0ccolored oops \u8fd8\u5305\u542b\u52a0\u8f7d\u5c4f\u969c\u4f7f\u7528\u7684\u4fe1\u606f\uff0c\u4ee5\u786e\u5b9a\u5728\u5141\u8bb8 Java \u7ebf\u7a0b\u4f7f\u7528\u6307\u9488\u4e4b\u524d\u662f\u5426\u9700\u8981\u91c7\u53d6\u67d0\u4e9b\u64cd\u4f5c\u3002\u4f8b\u5982\uff0c\u5bf9\u8c61\u6709\u53ef\u80fd\u5df2\u7ecf\u88ab\u91cd\u5b9a\u5411\uff0c\u90a3\u4e48\u52a0\u8f7d\u5c4f\u969c\u5c06\u5bf9\u6b64\u8fdb\u884c\u68c0\u6d4b\u5e76\u91c7\u53d6\u9002\u5f53\u7684\u64cd\u4f5c\u3002<\/p>\n

JEP 333 \u8fd8\u5c55\u793a\u4e86 ZGC \u7684\u6027\u80fd\u7b49\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bbf\u95ee\u00a0http:\/\/openjdk.java.net\/jeps\/333 \u67e5\u770b\u3002<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/www.oschina.net\/news\/97873\/jep-333-a-scalable-low-latency-garbage-collector<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1a https:\/\/lrxjmw.cn\/jdk11-reduce-delay.html<\/a>\u7f16\u8f91\uff1a\u738b\u5a77\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb \u4e4b\u524d\u6211\u4eec\u62a5\u5bfc\u8fc7JDK 11 \u8fdb\u5165\u7279\u6027\u51bb\u7ed3\u9636\u6bb5\uff0c\u4eca\u5929\u6765\u770b\u770bJEP 333\u4e3a\u4e86\u5927\u5e45\u51cf\u5c11 GC \u6682\u505c\u65f6\u95f4\u7684\u53ef\u4f38 […]<\/p>\n","protected":false},"author":1920,"featured_media":111427,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[21],"tags":[],"class_list":["post-111415","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/111415","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1920"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=111415"}],"version-history":[{"count":10,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/111415\/revisions"}],"predecessor-version":[{"id":111470,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/111415\/revisions\/111470"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/111427"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=111415"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=111415"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=111415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}