{"id":21212,"date":"2024-07-17T11:05:38","date_gmt":"2024-07-17T03:05:38","guid":{"rendered":"https:\/\/aif.amtbbs.org\/?p=21212"},"modified":"2024-07-17T11:05:38","modified_gmt":"2024-07-17T03:05:38","slug":"%e5%9f%ba%e4%ba%8enetty%e7%9a%84%e8%87%aa%e7%a0%94%e6%b5%81%e7%b3%bb%e7%bb%9f%e7%bc%93%e5%ad%98%e5%ae%9e%e7%8e%b0%e6%8c%91%e6%88%98-%e5%86%85%e5%ad%98%e7%a2%8e%e7%89%87%e4%b8%8eoom%e5%9b%b0%e5%a2%83","status":"publish","type":"post","link":"https:\/\/aif.amtbbs.org\/index.php\/2024\/07\/17\/21212\/","title":{"rendered":"\u57fa\u4e8eNetty\u7684\u81ea\u7814\u6d41\u7cfb\u7edf\u7f13\u5b58\u5b9e\u73b0\u6311\u6218: \u5185\u5b58\u788e\u7247\u4e0eOOM\u56f0\u5883"},"content":{"rendered":"<div><\/div>\n<div><img data-dominant-color=\"bcc9d6\" data-has-transparency=\"false\" style=\"--dominant-color: #bcc9d6;\" loading=\"lazy\" decoding=\"async\" class=\"not-transparent alignnone size-full wp-image-21214\" src=\"https:\/\/aiforumimage.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2024\/07\/7612bfc477d74d911c1468c4de3f65e1201315-300x167-1.jpg\" width=\"300\" height=\"167\" alt=\"\" srcset=\"https:\/\/aiforumimage.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2024\/07\/7612bfc477d74d911c1468c4de3f65e1201315-300x167-1.jpg 300w, https:\/\/aiforumimage.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2024\/07\/7612bfc477d74d911c1468c4de3f65e1201315-300x167-1-150x84.jpg 150w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/div>\n<div class=\"article-desc\">Netty \u7684 PooledByteBufAllocator \u4e0d\u662f\u94f6\u5f39\uff0c\u4f7f\u7528\u7684\u65f6\u5019\u9700\u8981\u8003\u8651\u5185\u5b58\u788e\u7247\u5e26\u6765\u7684\u5b9e\u9645\u5185\u5b58\u5360\u7528\u7684\u7a7a\u95f4\u653e\u5927\uff0c\u89c4\u5212\u9884\u7559\u51fa\u5408\u7406\u7684 JVM \u5185\u5b58\u5927\u5c0f\u3002<\/div>\n<div id=\"postspictures\" class=\"article-content\">\n<div id=\"container\" class=\"container am-engine\" data-v-1d7a5742=\"\" data-element=\"root\">\n<h3>1.\u524d\u8a00<\/h3>\n<p>&nbsp;<\/p>\n<p>Kafka \u4f5c\u4e3a\u6d41\u5904\u7406\u5e73\u53f0\uff0c\u5728\u5b9e\u65f6\u6d41\u8ba1\u7b97\u548c\u5728\u7ebf\u4e1a\u52a1\u573a\u666f\uff0c\u8ffd\u5c3e\u8bfb\u8ffd\u6c42\u7aef\u5230\u7aef\u4f4e\u5ef6\u8fdf\u3002\u5728\u79bb\u7ebf\u6279\u5904\u7406\u548c\u524a\u5cf0\u586b\u8c37\u573a\u666f\uff0c\u6570\u636e\u51b7\u8bfb\u8ffd\u6c42\u9ad8\u541e\u5410\u3002\u4e24\u4e2a\u573a\u666f\u90fd\u9700\u8981\u5f88\u597d\u7684\u6570\u636e\u7f13\u5b58\u8bbe\u8ba1\u6765\u652f\u6491\uff0cApache Kafka \u7684\u6570\u636e\u5b58\u50a8\u5728\u672c\u5730\u6587\u4ef6\uff0c\u901a\u8fc7 mmap \u5c06\u6587\u4ef6\u6620\u5c04\u5230\u5185\u5b58\u4e2d\u8bbf\u95ee\uff0c\u5929\u7136\u5c31\u53ef\u4ee5\u4f9d\u6258\u64cd\u4f5c\u7cfb\u7edf\u6765\u5b8c\u6210\u6587\u4ef6\u7684\u7f13\u51b2\u6301\u4e45\u5316\u3001\u7f13\u5b58\u52a0\u8f7d\u548c\u7f13\u5b58\u9a71\u9010\u3002<\/p>\n<p>AutoMQ \u91c7\u7528\u5b58\u7b97\u5206\u79bb\u7684\u67b6\u6784\uff0c\u5c06\u5b58\u50a8\u5206\u79bb\u81f3\u5bf9\u8c61\u5b58\u50a8\uff0c\u672c\u5730\u6ca1\u6709\u6570\u636e\u6587\u4ef6\uff0c\u56e0\u6b64\u65e0\u6cd5\u50cf Apache Kafka \u4e00\u6837\u76f4\u63a5\u4f7f\u7528\u6570\u636e\u6587\u4ef6 mmap \u6765\u8fdb\u884c\u6570\u636e\u7f13\u5b58\u3002\u8fd9\u65f6\u5019\u901a\u5e38\u7f13\u5b58\u5bf9\u8c61\u5b58\u50a8\u7684\u6570\u636e\u6709\u4e24\u79cd\u505a\u6cd5\uff1a<\/p>\n<ul data-id=\"ueafa794-f0mjf2Oa\">\n<li data-id=\"ld70c578-Hsia4KrM\">\u7b2c\u4e00\u79cd\u662f\u5c06\u5bf9\u8c61\u5b58\u50a8\u6587\u4ef6\u4e0b\u8f7d\u5230\u672c\u5730\u6587\u4ef6\uff0c\u7136\u540e\u518d\u901a\u8fc7 mmap \u8bfb\u53d6\u672c\u5730\u6587\u4ef6\u3002\u8fd9\u79cd\u505a\u6cd5\u5728\u5b9e\u73b0\u4e0a\u6bd4\u8f83\u7b80\u5355\uff0c\u4f46\u662f\u9700\u8981\u4e00\u5757\u989d\u5916\u7684\u78c1\u76d8\u6765\u7f13\u5b58\u6570\u636e\uff0c\u7136\u540e\u6839\u636e\u7f13\u5b58\u6240\u9700\u7684\u5927\u5c0f\u548c\u901f\u7387\uff0c\u8fd8\u9700\u8981\u8d2d\u4e70\u78c1\u76d8\u7a7a\u95f4\u548c IOPS\uff0c\u8be5\u505a\u6cd5\u4e0d\u591f\u7ecf\u6d4e\uff1b<\/li>\n<li data-id=\"ld70c578-G3k6nDSP\">\u7b2c\u4e8c\u79cd\u662f\u6839\u636e\u6d41\u5904\u7406\u7684\u6570\u636e\u6d88\u8d39\u7279\u5f81\uff0c\u76f4\u63a5\u57fa\u4e8e\u5185\u5b58\u6765\u8fdb\u884c\u6570\u636e\u7f13\u5b58\u3002\u8fd9\u79cd\u505a\u6cd5\u5b9e\u73b0\u8d77\u6765\u4f1a\u590d\u6742\u4e00\u4e9b\uff0c\u76f8\u5f53\u4e8e\u9700\u8981\u5b9e\u73b0\u4e00\u4e2a\u7c7b\u4f3c\u64cd\u4f5c\u7cfb\u7edf\u7684\u5185\u5b58\u7ba1\u7406\u3002\u4f46\u662f\u5c31\u50cf\u4e07\u4e8b\u4e07\u7269\u90fd\u6709\u4e24\u9762\u6027\u4e00\u6837\uff0c\u81ea\u5df1\u5b9e\u73b0\u5185\u5b58\u7f13\u5b58\u7ba1\u7406\uff0c\u5c31\u53ef\u4ee5\u6839\u636e\u4e1a\u52a1\u573a\u666f\u53d6\u5f97\u6700\u4f73\u7684\u7f13\u5b58\u6548\u7387\u548c\u7ecf\u6d4e\u6027\u3002<\/li>\n<\/ul>\n<p>\u4e3a\u4e86\u964d\u4f4e\u8fd0\u7ef4\u7684\u590d\u6742\u6027\u548c\u6301\u6709\u6210\u672c\uff0c\u63d0\u9ad8\u7f13\u5b58\u7684\u6548\u7387\uff0cAutoMQ \u6700\u7ec8\u9009\u62e9\u7684\u662f\u7b2c\u4e8c\u79cd\u505a\u6cd5\uff1a\u201c\u76f4\u63a5\u57fa\u4e8e\u5185\u5b58\u6765\u8fdb\u884c\u6570\u636e\u7f13\u5b58\u201d\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>2.AutoMQ \u7f13\u5b58\u8bbe\u8ba1<\/h3>\n<p>&nbsp;<\/p>\n<p>\u76f4\u63a5\u57fa\u4e8e\u5185\u5b58\u6765\u8fdb\u884c\u6570\u636e\u7f13\u5b58\uff0cAutoMQ \u9488\u5bf9\u8ffd\u5c3e\u8bfb\u548c\u51b7\u8bfb\u4e24\u4e2a\u573a\u666f\uff0c\u6839\u636e\u4e24\u8005\u7684\u6570\u636e\u8bbf\u95ee\u7279\u70b9\uff0c\u8bbe\u8ba1\u4e86\u4e24\u5957\u7f13\u5b58\u673a\u5236\uff1aLogCache \u548c BlockCache\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" title=\"\u56fe\u7247\" src=\"https:\/\/s2.51cto.com\/oss\/202407\/17\/06d562c54397a364c3c413ae83fde4c65079e7.png\" alt=\"\u56fe\u7247\" data-type=\"block\" \/><span class=\"data-image-title\">\u56fe\u7247<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>LogCache \u9488\u5bf9\u4e8e\u8ffd\u5c3e\u8bfb\u573a\u666f\u8bbe\u8ba1\uff0c\u6570\u636e\u4e0a\u4f20\u5230\u5bf9\u8c61\u5b58\u50a8\u7684\u540c\u65f6\uff0c\u4e5f\u4f1a\u4ee5\u5355\u4e2a RecordBatch \u7684\u5f62\u5f0f\u5728 LogCache \u4e2d\u7f13\u5b58\u4e00\u4efd\uff0c\u8fd9\u6837\u70ed\u6570\u636e\u5c31\u53ef\u4ee5\u4ece\u76f4\u63a5\u7f13\u5b58\u4e2d\u83b7\u53d6\uff0c\u63d0\u4f9b\u6781\u4f4e\u7684\u7aef\u5230\u7aef\u5ef6\u8fdf\u3002\u76f8\u6bd4\u64cd\u4f5c\u7cfb\u7edf\u901a\u7528\u7684\u7f13\u5b58\u8bbe\u8ba1\uff0cLogCache \u8fd8\u5177\u5907\u4ee5\u4e0b\u4e24\u4e2a\u7279\u8d28\uff1a<\/p>\n<ul data-id=\"ueafa794-lfLP3Z0b\">\n<li data-id=\"ld70c578-rWB8pBaU\">FIFO\uff1a\u9488\u5bf9\u8ffd\u5c3e\u8bfb\u6301\u7eed\u8bbf\u95ee\u65b0\u6570\u636e\u7684\u7279\u70b9\uff0cLogCache \u91c7\u7528\u5148\u5165\u5148\u51fa\u7684\u7f13\u5b58\u9a71\u9010\u7b56\u7565\uff0c\u4f18\u5148\u4fdd\u8bc1\u65b0\u6570\u636e\u7f13\u5b58\u7684\u53ef\u7528\u6027\uff1b<\/li>\n<li data-id=\"ld70c578-NUZBxACr\">\u4f4e\u5ef6\u8fdf\uff1aLogCache \u6709\u72ec\u5360\u7684\u7f13\u5b58\u7a7a\u95f4\uff0c\u53ea\u8d1f\u8d23\u70ed\u6570\u636e\u7684\u7f13\u5b58\uff0c\u907f\u514d\u4e86\u51b7\u6570\u636e\u8bfb\u53d6\u5f71\u54cd\u70ed\u6570\u636e\u6d88\u8d39\u7684\u95ee\u9898\u3002<\/li>\n<\/ul>\n<p>BlockCache \u9488\u5bf9\u51b7\u8bfb\u573a\u666f\u8bbe\u8ba1\uff0c\u5f53\u65e0\u6cd5\u5728 LogCache \u4e2d\u8bbf\u95ee\u5230\u9700\u8981\u7684\u6570\u636e\u65f6\uff0c\u5219\u4ece BlockCache \u4e2d\u8bfb\u53d6\u3002BlockCache \u76f8\u6bd4 LogCache \u5177\u5907\u4ee5\u4e0b\u4e24\u4e2a\u4e0d\u540c\u70b9\uff1a<\/p>\n<ul data-id=\"ueafa794-o6COOS6Z\">\n<li data-id=\"ld70c578-ZbhmREAs\">LRU\uff1aBlockCache \u4f7f\u7528 Least Recently Used \u7b56\u7565\u6765\u8fdb\u884c\u7f13\u5b58\u9a71\u9010\uff0c\u5728\u591a\u500d Fanout \u7684\u51b7\u8bfb\u573a\u666f\u53ef\u4ee5\u83b7\u5f97\u66f4\u4f73\u7684\u7f13\u5b58\u5229\u7528\u7387\uff1b<\/li>\n<li data-id=\"ld70c578-wWobrFvQ\">\u9ad8\u541e\u5410\uff1a\u51b7\u8bfb\u5173\u6ce8\u7684\u662f\u541e\u5410\u91cf\uff0c\u56e0\u6b64 BlockCache \u4f1a\u5927\u5757\uff08\uff5e4MB\uff09\u7684\u4ece\u5bf9\u8c61\u5b58\u50a8\u8bfb\u53d6 &amp; \u7f13\u5b58\u6570\u636e\uff0c\u5e76\u4e14\u901a\u8fc7\u9884\u8bfb\u7b56\u7565\u6765\u63d0\u524d\u52a0\u8f7d\u540e\u7eed\u53ef\u80fd\u8bfb\u53d6\u7684\u6570\u636e\uff1b<\/li>\n<\/ul>\n<p>Java \u7a0b\u5e8f\u4e2d\u5728\u5185\u5b58\u4e2d\u7f13\u5b58\u6570\u636e\u53ef\u4ee5\u9009\u62e9\u5806\u5185\u5185\u5b58\u6216\u5806\u5916\u5185\u5b58\u3002\u4e3a\u4e86\u51cf\u8f7b JVM GC \u7684\u8d1f\u62c5\uff0cAutoMQ \u4f7f\u7528\u5806\u5916\u5185\u5b58\u00a0Direct Memory\u00a0\u6765\u7f13\u5b58\u6570\u636e\uff0c\u5e76\u4e14\u4e3a\u4e86\u63d0\u9ad8 Direct Memory \u7684\u7533\u8bf7\u6548\u7387\uff0c\u91c7\u7528\u4e1a\u754c\u6210\u719f\u7684 Netty PooledByteBufAllocator \u4ece\u6c60\u5316\u5185\u5b58\u4e2d\u8fdb\u884c\u5185\u5b58\u7684\u7533\u8bf7\u548c\u91ca\u653e\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>3.\u201c\u60e8\u6848\u201d\u53d1\u751f<\/h3>\n<p>&nbsp;<\/p>\n<p>\u671f\u671b\u662f\u4f7f\u7528 Netty \u7684 PooledByteBufAllocator \u540e\uff0cAutoMQ \u65e2\u53ef\u4ee5\u901a\u8fc7\u6c60\u5316\u6765\u83b7\u5f97\u9ad8\u6548\u7684\u5185\u5b58\u5206\u914d\u901f\u5ea6\uff0c\u53c8\u6709\u4e45\u7ecf\u6253\u78e8\u7684\u5185\u5b58\u5206\u914d\u7b56\u7565\u6765\u6700\u5c0f\u5316\u5185\u5b58\u5206\u914d\u7684 Overhead\uff0c\u5c31\u53ef\u4ee5\u9ad8\u6795\u65e0\u5fe7\u65e0\u5fe7\u4e86\uff0c\u7136\u800c\u5728 AutoMQ 1.0.0 RC \u538b\u6d4b\u8fc7\u7a0b\u4e2d\u88ab\u73b0\u5b9e\u7ed9\u4e86\u5f53\u5934\u4e00\u68d2\u3002<\/p>\n<p>AutoMQ \u751f\u4ea7\u673a\u578b\u4e3a 2C16G\uff0c\u8bbe\u7f6e\u5806\u5916\u5185\u5b58\u4f7f\u7528\u4e0a\u9650 6GiB -XX:MaxDirectMemorySize=6G\uff0c\u5185\u5b58\u5206\u914d\u4e3a 2GiB LogCache + 1GiB BlockCache + 1GiB \u5176\u4ed6\u5c0f\u9879 \uff5e= 4GiB &lt; 6GiB\u3002\u7406\u8bba\u8ba1\u7b97\u4e0b\uff0c\u5806\u5916\u5185\u5b58\u8fd8\u7ef0\u7ef0\u6709\u4f59\uff0c\u7136\u800c\u5728\u5b9e\u9645 AutoMQ 1.0.0 RC \u7248\u5728\u5404\u79cd\u4e0d\u540c\u8d1f\u8f7d\u4e0b\u957f\u65f6\u95f4\u8fd0\u884c\u540e\u53d1\u73b0\uff0c\u5206\u914d\u5185\u5b58\u6709 OOM OutOfMemoryError \u5f02\u5e38\u629b\u51fa\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u672c\u7740\u4f18\u5148\u6000\u7591\u81ea\u5df1\u800c\u4e0d\u662f\u6000\u7591\u6210\u719f\u7684\u7c7b\u5e93\u548c\u64cd\u4f5c\u7cfb\u7edf\u7684\u539f\u5219\u3002<\/p>\n<p>\u89c2\u6d4b\u5230\u5f02\u5e38\u540e\uff0c\u9996\u5148\u6000\u7591\u7684\u662f\u4ee3\u7801\u4e2d\u54ea\u91cc\u6709\u9057\u6f0f\u8c03\u7528 ByteBuf#release\u3002\u4e8e\u662f\u8c03\u6574 Netty \u7684\u6cc4\u6f0f\u68c0\u6d4b\u7b49\u7ea7 -Dio.netty.leakDetection.level=PARANOID\uff0c\u68c0\u6d4b\u6bcf\u4e2a\u7684 ByteBuf \u662f\u5426\u6709\u5b58\u5728\u88ab GC \u4f46\u662f\u8fd8\u6ca1\u6709\u88ab\u91ca\u653e\u7684\u95ee\u9898\u3002\u8dd1\u4e86\u4e00\u6bb5\u65f6\u95f4\u672a\u53d1\u73b0\u6709 Leak \u65e5\u5fd7\uff0c\u4e8e\u662f\u4e4e\u6392\u9664\u6f0f\u91ca\u653e\u7684\u53ef\u80fd\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u63a5\u7740\u6000\u7591\u70b9\u8f6c\u79fb\u5230\u662f\u5426\u4ee3\u7801\u4e2d\u6709\u54ea\u5757\u5185\u5b58\u5206\u914d\u91cf\u8d85\u51fa\u4e86\u9884\u671f\u503c\u3002Netty \u7684 ByteBufAllocatorMetric\u53ea\u63d0\u4f9b\u5168\u5c40\u7684\u5185\u5b58\u5360\u7528\u7edf\u8ba1\uff0c\u4f20\u7edf\u7684\u5185\u5b58\u5206\u914d\u706b\u7130\u56fe\u4e5f\u53ea\u80fd\u63d0\u4f9b\u7279\u5b9a\u65f6\u95f4\u7684\u5185\u5b58\u7533\u8bf7\u91cf\uff0c\u800c\u6211\u4eec\u9700\u8981\u7684\u662f\u67d0\u4e2a\u65f6\u523b\u5404\u79cd\u7c7b\u578b\u7684\u5185\u5b58\u4f7f\u7528\u91cf\u3002\u56e0\u6b64 AutoMQ \u5c06 ByteBuf \u7684\u7533\u8bf7\u6536\u53e3\u5230\u81ea\u5df1\u5b9e\u73b0\u7684 ByteBufAlloc\u5de5\u5382\u7c7b\u4e2d\uff0c\u901a\u8fc7WrappedByteBuf \u8ddf\u8e2a\u5404\u79cd\u7c7b\u578b\u5185\u5b58\u7684\u7533\u8bf7\u548c\u91ca\u653e\uff0c\u4ee5\u6b64\u6765\u8bb0\u5f55\u5f53\u524d\u65f6\u523b\u5404\u4e2a\u7c7b\u578b\u7684\u5185\u5b58\u4f7f\u7528\u91cf\u3002\u5e76\u4e14\u5c06 Netty \u7684\u5b9e\u9645\u5185\u5b58\u4f7f\u7528\u91cf\u4e5f\u8bb0\u5f55\u4e0b\u6765\uff0c\u8fd9\u6837\u5c31\u77e5\u9053 AutoMQ \u603b\u4f53\u5185\u5b58\u548c\u5206\u7c7b\u5185\u5b58\u7684\u4f7f\u7528\u91cf\u3002<\/p>\n<div>\n<div class=\"hljs-cto\">\n<div class=\"hljs-cto\"><button class=\"copy_btn disable\" data-clipboard-target=\"#code_id_0\">\u590d\u5236<\/button><\/p>\n<div class=\"code-toolbar\">\n<pre class=\"has-pre-numbering language-sql\" tabindex=\"0\"><code class=\"language-sql\">Buffer <span class=\"token keyword\">usage<\/span>: \r\nByteBufAllocMetric{allocatorMetric<span class=\"token operator\">=<\/span>PooledByteBufAllocatorMetric<span class=\"token punctuation\">(<\/span>usedDirectMemory: <span class=\"token number\">2294284288<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token comment\">\/\/ Physical Memory Size Allocated by Netty<\/span>\r\nallocatedMemory<span class=\"token operator\">=<\/span><span class=\"token number\">1870424720<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token comment\">\/\/ Total Memory Size Requested By AutoMQ<\/span>\r\n<span class=\"token number\">1<\/span><span class=\"token operator\">\/<\/span>write_record<span class=\"token operator\">=<\/span><span class=\"token number\">1841299456<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">11<\/span><span class=\"token operator\">\/<\/span>block_cache<span class=\"token operator\">=<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">.<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token comment\">\/\/ Detail Memory Size Requested By AutoMQ<\/span>\r\npooled<span class=\"token operator\">=<\/span><span class=\"token boolean\">true<\/span><span class=\"token punctuation\">,<\/span> direct<span class=\"token operator\">=<\/span><span class=\"token boolean\">true<\/span>} <span class=\"token punctuation\">(<\/span>com<span class=\"token punctuation\">.<\/span>automq<span class=\"token punctuation\">.<\/span>stream<span class=\"token punctuation\">.<\/span>s3<span class=\"token punctuation\">.<\/span>ByteBufAlloc<span class=\"token punctuation\">)<\/span><\/code><\/pre>\n<ul id=\"code_id_0\" class=\"pre-numbering\">\n<li>1.<\/li>\n<li>2.<\/li>\n<li>3.<\/li>\n<li>4.<\/li>\n<li>5.<\/li>\n<\/ul>\n<div class=\"toolbar\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<p>\u52a0\u4e0a\u5206\u7c7b\u5185\u5b58\u7edf\u8ba1\u540e\uff0c\u53d1\u73b0\u5404\u79cd\u7c7b\u578b\u7684\u5185\u5b58\u4f7f\u7528\u91cf\u90fd\u5728\u9884\u671f\u8303\u56f4\u5185\u3002\u4e0d\u8fc7\u5f02\u5e38\u7684\u662f\uff0cAutoMQ \u7533\u8bf7\u7684\u5185\u5b58\u91cf\u548c Netty \u5b9e\u9645\u7533\u8bf7\u7684\u5185\u5b58\u91cf\u6709\u8f83\u5927\u7684\u5dee\u8ddd\uff0c\u5e76\u4e14\u968f\u7740\u8fd0\u884c\u4e24\u8005\u4e4b\u95f4\u7684\u5dee\u503c\u8d8a\u6765\u8d8a\u5927\uff0c\u751a\u81f3\u6709\u65f6\u5019 Netty \u5b9e\u9645\u5347\u7ea7\u7684\u5185\u5b58\u662f AutoMQ \u7533\u8bf7\u7684\u5185\u5b58\u91cf\u7684\u4e24\u500d\uff0c\u8fd9\u4e2a\u5dee\u503c\u4e3a\u5185\u5b58\u5206\u914d\u7684\u5185\u5b58\u788e\u7247\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u6700\u7ec8 OOM \u7684\u8bf1\u53d1\u539f\u56e0\u5b9a\u4f4d\u4e3a Netty PooledByteBufAllocator \u7684\u5185\u5b58\u788e\u7247\u3002\u521d\u6b65\u5b9a\u4f4d\u4e86\u95ee\u9898\u7684\u539f\u56e0\uff0c\u90a3\u4e48\u95ee\u9898\u8f6c\u6362\u4e3a Netty \u4e3a\u4ec0\u4e48\u4f1a\u6709\u5185\u5b58\u788e\u7247\u548c AutoMQ \u5982\u4f55\u89c4\u907f\u5185\u5b58\u788e\u7247\u95ee\u9898\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>4.Netty \u5185\u5b58\u788e\u7247<\/h3>\n<p>&nbsp;<\/p>\n<p>\u9996\u5148\u6211\u4eec\u6765\u63a2\u7d22\u4e00\u4e0b Netty \u5185\u5b58\u788e\u7247\u7684\u539f\u56e0\u3002Netty \u7684\u5185\u5b58\u788e\u7247\u5206\u4e3a\u5185\u90e8\u788e\u7247\u548c\u5916\u90e8\u788e\u7247\uff1a<\/p>\n<ul data-id=\"ueafa794-jcMYfFen\">\n<li data-id=\"ld70c578-wWksPZn1\">\u5185\u90e8\u788e\u7247\uff1a\u7531\u4e8e size \u89c4\u7ea6\u5316\u5bf9\u9f50\u5f15\u8d77\u7684\u788e\u7247\uff0c\u4f8b\u5982\u671f\u671b\u5206\u914d 1byte\uff0c\u4f46\u662f\u5e95\u5c42\u5b9e\u9645\u5360\u7528\u4e86 16byte\uff0c\u90a3\u4e48\u5185\u90e8\u788e\u7247\u5c31\u6d6a\u8d39\u4e86 15byte\uff1b<\/li>\n<li data-id=\"ld70c578-6CZCoGTi\">\u5916\u90e8\u788e\u7247\uff1a\u7b80\u5355\u7684\u6765\u8bf4\uff0c\u6240\u6709\u9664\u4e86\u5185\u90e8\u788e\u7247\u4ee5\u5916\u5f15\u8d77\u7684\u788e\u7247\u90fd\u7b97\u5916\u90e8\u788e\u7247\uff0c\u901a\u5e38\u662f\u7531\u4e8e\u5206\u914d\u7b97\u6cd5\u5bfc\u81f4\u7684\u5185\u5b58\u5e03\u5c40\u788e\u7247\u5bfc\u81f4\u7684\uff1b<\/li>\n<\/ul>\n<p>\u5185\u90e8\u788e\u7247\u548c\u5916\u90e8\u788e\u7247\uff0c\u5728\u4e0d\u540c\u7684 Netty \u7248\u672c\u6709\u4e0d\u540c\u7684\u8868\u73b0\uff0c\u4e0b\u9762\u5c06\u4ee5 Netty 4.1.52 \u7248\u672c\u4e3a\u5206\u5272\u7ebf\u7b80\u8981\u4ecb\u7ecd\u4e00\u4e0b Buddy \u5206\u914d\u7b97\u6cd5\u548c PageRun\/PoolSubPage \u5206\u914d\u7b97\u6cd5\u7684\u5de5\u4f5c\u673a\u5236\u548c\u5185\u5b58\u788e\u7247\u6210\u56e0\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h4>4.1\u00a0Buddy \u5206\u914d\u7b97\u6cd5 Netty &lt; 4.1.52<\/h4>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Netty &lt; 4.1.52 \u91c7\u7528 Buddy \u5206\u914d\u7b97\u6cd5\uff0c\u7b97\u6cd5\u6e90\u81ea jemalloc3\u3002Netty \u4e3a\u4e86\u63d0\u5347\u5185\u5b58\u7533\u8bf7\u7684\u6548\u7387\uff0c\u4f1a\u4e00\u6b21\u6027\u4ece\u64cd\u4f5c\u7cfb\u7edf\u7533\u8bf7\u4e00\u6bb5\u8fde\u7eed\u5185\u5b58\uff08PoolChunk\uff09\uff0c\u5728\u4e0a\u5c42\u7533\u8bf7 ByteBuf \u65f6\uff0c\u6309\u9700\u5c06\u8fd9\u4e00\u6bb5\u5185\u5b58\u903b\u8f91\u62c6\u5206\u8fd4\u56de\u7ed9\u4e0a\u5c42\u3002\u9ed8\u8ba4 PoolChunk \u7684\u5927\u5c0f\u4e3a 16MB\uff0cPoolChunk \u903b\u8f91\u4e0a\u88ab\u5212\u5206\u4e3a 2048 \u4e2a 8KB \u5927\u5c0f\u7684 Page\uff0c\u901a\u8fc7\u4e00\u4e2a\u5b8c\u5168\u4e8c\u53c9\u6811\u6765\u8868\u793a\u5185\u5b58\u7684\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" title=\"\u56fe\u7247\" src=\"https:\/\/s5.51cto.com\/oss\/202407\/17\/d72b8d0489af834e27839173a8bcbafa882fd3.png\" alt=\"\u56fe\u7247\" data-type=\"block\" \/><span class=\"data-image-title\">\u56fe\u7247<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u5b8c\u5168\u4e8c\u53c9\u6811\u7684\u6bcf\u4e2a\u8282\u70b9\u7528\u4e00\u4e2a byte \u6765\u8868\u793a\u8282\u70b9\u7684\u72b6\u6001\uff08memoryMap\uff09\uff1a<\/p>\n<ul data-id=\"ueafa794-q4fnkkC8\">\n<li data-id=\"ld70c578-QVDgdPB7\">\u521d\u59cb\u503c\u4e3a\u5c42\u6570\uff0c\u72b6\u6001\u503c == \u5c42\u6570\u4ee3\u8868\u8be5\u8282\u70b9\u5b8c\u5168\u7a7a\u95f2\uff1b<\/li>\n<li data-id=\"ld70c578-YkhLaRZg\">\u5f53\u5c42\u6570 &lt; \u72b6\u6001\u503c &lt; 12 \u65f6\uff0c\u4ee3\u8868\u8be5\u8282\u70b9\u88ab\u4f7f\u7528\u4e86\u4e00\u90e8\u5206\uff0c\u4f46\u4ecd\u65e7\u6709\u5269\u4f59\u7a7a\u95f4\uff1b<\/li>\n<li data-id=\"ld70c578-kxwvZTPp\">\u5f53\u72b6\u6001\u503c == 12 \u65f6\uff0c\u4ee3\u8868\u8be5\u8282\u70b9\u5df2\u7ecf\u88ab\u5b8c\u5168\u5206\u914d\uff1b<\/li>\n<\/ul>\n<p>\u5185\u5b58\u5206\u914d\u5206\u4e3a Tiny [0\uff0c 512byte] \u3001 Small \uff08512byte\uff0c 8KB\uff09 \u3001 Normal [8KB\uff0c 16M] \u548c Huge \uff0816M\uff0c Max\uff09 \u56db\u79cd\u7c7b\u578b\uff0c\u5176\u4e2d Tiny \u548c Small \u7531 PoolSubpage \u8d1f\u8d23\uff0cNormal \u7531 PoolChunk \u8d1f\u8d23\uff0cHuge \u76f4\u63a5\u5206\u914d\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u5148\u6765\u770b\u770b\u5c0f\u5185\u5b58\u5757\u7684\u5206\u914d\u6548\u7387\uff0cTiny [0\uff0c 512byte] \u548c Small \uff08512byte\uff0c 8KB\uff09 \u5c06\u4e00\u4e2a Page \u901a\u8fc7 PoolSubpage \u5207\u5206\u6210\u7b49\u957f\u7684\u903b\u8f91\u5757\uff0c\u7531\u4e00\u4e2a bitmap \u6765\u6807\u8bb0\u5757\u7684\u4f7f\u7528\u60c5\u51b5\uff1a<\/p>\n<ul data-id=\"ueafa794-ec3EdoFj\">\n<li data-id=\"ld70c578-eYH9VASN\">Tiny \u5185\u5b58\u5206\u914d\u7684\u57fa\u7840\u5355\u4f4d\u4e3a 16 byte\uff0c\u610f\u5473\u7740\u5982\u679c\u8bf7\u6c42\u5927\u5c0f\u4e3a 50 byte\uff0c\u5b9e\u9645\u5206\u914d\u7684\u662f 64 byte\uff0c\u5185\u90e8\u788e\u7247\u7387\u4e3a 28%\uff1b<\/li>\n<li data-id=\"ld70c578-3vt0EWeT\">Small \u5185\u5b58\u5206\u914d\u7684\u57fa\u7840\u5355\u4f4d\u662f 1KB\uff0c\u610f\u5473\u7740\u8bf7\u6c42\u5927\u5c0f\u4e3a 1.5KB\uff0c\u5b9e\u9645\u5206\u914d\u7684\u662f 2KB\uff0c\u5185\u90e8\u788e\u7247\u7387\u4e3a 25%\uff1b<\/li>\n<\/ul>\n<p>\u518d\u6765\u770b\u770b\u4e2d\u7b49\u7684\u5185\u5b58\u5757 Normal [8KB\uff0c 16M]\uff0c\u5047\u8bbe\u4ece\u4e00\u4e2a\u5b8c\u5168\u7a7a\u95f2\u7684 PoolChunk \u7533\u8bf7 2MB + 1KB = 2049KB \u5185\u5b58\uff1a<\/p>\n<ul class=\"list-paddingleft-1\" data-id=\"u00037f9-l8kJKBlm\">\n<li data-id=\"ld70c578-N9z5Ni7f\">2049KB \u4ee5 2 \u4e3a\u5e95\u5411\u4e0a\u89c4\u683c\u5316\u540e\u53d8\u4e3a 4MB\uff0c\u4e8e\u662f\u67e5\u627e\u76ee\u6807\u4e3a Depth-3 \u7684\u7a7a\u95f2\u8282\u70b9\uff1b<\/li>\n<li data-id=\"ld70c578-bYFEPhiF\">\u68c0\u67e5 index=1 \u8282\u70b9\uff0c\u53d1\u73b0\u8282\u70b9\u6709\u7a7a\u95f2\uff0c\u5219\u68c0\u67e5\u5de6\u5b50\u6811\uff1b<\/li>\n<li data-id=\"ld70c578-j58LOHCA\">\u68c0\u67e5 index=2 \u8282\u70b9\uff0c\u53d1\u73b0\u8282\u70b9\u6709\u7a7a\u95f2\uff0c\u5219\u7ee7\u7eed\u68c0\u67e5\u5de6\u5b50\u6811\uff1b<\/li>\n<li data-id=\"ld70c578-h90AA1Y9\">\u68c0\u67e5 index=4 \u8282\u70b9\uff0c\u53d1\u73b0\u8282\u70b9\u672a\u88ab\u5206\u914d\uff0c\u5219\u5c06 index=4 \u7684\u72b6\u6001\u6807\u8bb0\u4e3a 12\uff0c\u5e76\u4e14\u5c06\u7236\u8282\u70b9\u7684\u72b6\u6001\u66f4\u65b0\u4e3a\u4e24\u4e2a\u5b50\u8282\u70b9\u4e2d\u6700\u5c0f\u7684\u90a3\u4e2a\uff0c\u4e5f\u5c31\u662f\u5c06 index=2 \u7684\u72b6\u6001\u53d8\u4e3a 3\uff0c\u540c\u7406\u4f9d\u6b21\u66f4\u65b0\u7236\u8282\u70b9\u72b6\u6001\uff1b<\/li>\n<li data-id=\"ld70c578-ae0Vv3gq\">\u5206\u914d\u5b8c\u6210\uff1b<\/li>\n<\/ul>\n<p>\u4ece\u5206\u914d\u7ed3\u679c\u53ef\u4ee5\u770b\u51fa\uff0c\u7533\u8bf7 2049KB \u5185\u5b58\uff0c\u5b9e\u9645\u6807\u8bb0\u5360\u7528 4MB \u5185\u5b58\uff0c\u610f\u5473\u7740\u5185\u90e8\u788e\u7247\u7387\u4e3a 49.9%\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u5047\u8bbe\u518d\u7533\u8bf7\u4e00\u4e2a 9MB \u7684\u5185\u5b58\uff0c\u867d\u7136\u521a\u624d\u7684 PoolChunk \u4ecd\u6709 12MB \u7684\u5269\u4f59\u7a7a\u95f4\uff0c\u4f46\u662f\u7531\u4e8e Buddy \u5185\u5b58\u5206\u914d\u7b97\u6cd5\u7684\u539f\u7406\uff0cindex=1 \u5df2\u7ecf\u88ab\u5360\u7528\u4e86\u90e8\u5206\uff0c\u6b64\u65f6\u53ea\u80fd\u65b0\u5f00\u4e00\u4e2a PoolChunk \u6765\u5206\u914d 9MB \u7684\u5185\u5b58\u3002\u5206\u914d\u540e\u7684\u5916\u90e8\u788e\u7247\u7387\u4e3a 1 &#8211; \uff084MB + 9MB\uff09 \/ 32MB = 59.3%\u3002\u6700\u7ec8\u6240\u9700\u5185\u5b58 \/ \u5e95\u5c42\u5b9e\u9645\u5360\u7528\u5185\u5b58 = \u6709\u6548\u5185\u5b58\u5229\u7528\u7387 = \u4ec5\u4e3a 34.3%\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u66f4\u8fdb\u4e00\u6b65\uff0c\u5728\u5404\u79cd\u4e0d\u540c\u5927\u5c0f\u7684\u5185\u5b58\u5757\u6301\u7eed\u7684\u5206\u914d\u91ca\u653e\u573a\u666f\uff0c\u5373\u4f7f PoolChunk \u5b9e\u9645\u5206\u914d\u51fa\u53bb\u7684\u7a7a\u95f4\u4e0d\u5927\uff0c\u4e5f\u6709\u53ef\u80fd\u88ab\u96f6\u6563\u7684\u5185\u5b58\u5757\u903b\u8f91\u5206\u5272\uff0c\u8fdb\u4e00\u6b65\u589e\u52a0\u66f4\u591a\u7684\u5916\u90e8\u5185\u5b58\u788e\u7247\u3002\u4ee5\u4e0b\u56fe\u4e3a\u4f8b\uff0c\u867d\u7136\u4e0a\u5c42\u5e94\u7528\u6700\u7ec8\u53ea\u4fdd\u7559\u4e86 4 * 8KB\uff0c\u4f46\u662f\u5df2\u7ecf\u65e0\u6cd5\u518d\u4ece\u8fd9\u4e2a PoolChunk \u7533\u8bf7 4MB \u7684\u5185\u5b58\u4e86\u3002<\/p>\n<p><img decoding=\"async\" title=\"\u56fe\u7247\" src=\"https:\/\/s2.51cto.com\/oss\/202407\/17\/017212373999090ea1a7184313e166e21c28c3.png\" alt=\"\u56fe\u7247\" data-type=\"block\" \/><span class=\"data-image-title\">\u56fe\u7247<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h4>4.2 PageRun\/PoolSubpage \u5206\u914d\u7b97\u6cd5 Netty &gt;= 4.1.52<\/h4>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Netty &gt;= 4.1.52 \u53c2\u8003 jemalloc4 \u5c06\u5185\u5b58\u5206\u914d\u5347\u7ea7\u5230 PageRun\/PoolSubPage \u5206\u914d\u7b56\u7565\u3002\u76f8\u6bd4\u539f\u6765\u7684 Buddy \u5206\u914d\u7b97\u6cd5\u65e0\u8bba\u5728\u5c0f\u5185\u5b58\u7684\u5206\u914d\u8fd8\u662f\u5728\u5927\u5185\u5b58\u7684\u5206\u914d\u90fd\u6709\u4f4e\u7684\u5185\u90e8 &amp; \u5916\u90e8\u5185\u5b58\u788e\u7247\u7387\u3002<\/p>\n<p>PageRun\/PoolSubpage \u5206\u914d\u7b97\u6cd5\u76f8\u6bd4\u539f\u6765 Buddy \u5206\u914d\u7b97\u6cd5\uff1a<\/p>\n<ul data-id=\"ueafa794-hWOO5lpr\">\n<li data-id=\"ld70c578-onchlw45\">Chunk \u9ed8\u8ba4\u5927\u5c0f\u4ece 16MB \u53d8\u4e3a 4MB\uff1b<\/li>\n<li data-id=\"ld70c578-dyiDsqxW\">\u4fdd\u7559\u4e86 Chunk \u548c Page\uff0c\u589e\u52a0\u4e86 Run \u7684\u6982\u5ff5\uff0c\u4e00\u4e32\u8fde\u7eed\u7684 Pages \u7ec4\u6210\u4e00\u4e2a Run\uff0c\u901a\u8fc7 Run \u6765\u5206\u914d Normal \uff0828KB\uff0c 4MB\uff09 \u00a0\u4e2d\u7b49\u5185\u5b58\uff1b<\/li>\n<li data-id=\"ld70c578-ztb2GR3I\">\u5c06 Tiny \u548c Small \u7ea7\u522b\u7684\u5185\u5b58\u5757\u66ff\u6362\u6210\u53ef\u8de8\u591a\u4e2a Page &amp; [16byte &#8230; 28KB] \u5171 38 \u7ea7\u57fa\u7840\u5206\u914d\u5927\u5c0f\u7684 PoolSubpage\uff1b<\/li>\n<\/ul>\n<p><img decoding=\"async\" title=\"\u56fe\u7247\" src=\"https:\/\/s7.51cto.com\/oss\/202407\/17\/1137ca360ab6aa75a8c691e61358c06add96cc.png\" alt=\"\u56fe\u7247\" data-type=\"block\" \/><span class=\"data-image-title\">\u56fe\u7247<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u9996\u5148\u4ecd\u65e7\u662f\u5148\u770b\u770b\u5c0f\u5185\u5b58\u5757\u7684\u5206\u914d\u6548\u7387\uff0c\u4ee5\u7533\u8bf7 1025 byte \u4e3a\u4f8b\uff1a<\/p>\n<ul data-id=\"u738a58b-LTUmChAk\">\n<li data-id=\"ld70c578-4bHojCVK\">\u00a0\u9996\u5148 1025 \u4f1a\u6839\u636e PoolSubpage \u7ea7\u522b\u89c4\u7ea6\u5230 1280 \u8fd9\u4e2a\u57fa\u7840\u5206\u914d\u5927\u5c0f\uff1b<\/li>\n<\/ul>\n<div>\n<div class=\"hljs-cto\">\n<div class=\"hljs-cto\"><button class=\"copy_btn disable\" data-clipboard-target=\"#code_id_1\">\u590d\u5236<\/button><\/p>\n<div class=\"code-toolbar\">\n<pre class=\"has-pre-numbering language-plain\" tabindex=\"0\"><code class=\"language-plain\">sizeIdx2sizeTab=[16, 32, 48, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 448, 512, 640, 768, 896, 1024, 1280, 1536, 1792, 2048, 2560, 3072, 3584, 4096, 5120, 6144, 7168, 8192, 10240, 12288, 14336, 16384, 20480, 24576, 28672, ...]<\/code><\/pre>\n<ul id=\"code_id_1\" class=\"pre-numbering\">\n<li>1.<\/li>\n<\/ul>\n<div class=\"toolbar\"><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<ul data-id=\"u738a58b-B236XWma\">\n<li data-id=\"ld70c578-7eKI5FPf\">\u7136\u540e PoolChunk \u4f1a\u5bf9 1280 byte \u548c Page Size 8K \u53d6\u6700\u5c0f\u516c\u500d\u6570 40KB \u6765\u51b3\u5b9a\u8be5 PoolSubPage \u5305\u542b \u00a05 \u4e2a Pages\uff1b<\/li>\n<li data-id=\"ld70c578-6rnaNQBD\">\u4ece PoolChunk \u4e2d\u5206\u914d 5 \u4e2a\u8fde\u7eed\u7684 Pages\uff0c\u5e76\u901a\u8fc7 bitmapIdx \u8bb0\u5f55\u5df2\u5206\u914d\u51fa\u53bb\u7684 element\uff1b<\/li>\n<li data-id=\"ld70c578-6cCbfwpu\">\u81f3\u6b64\u5206\u914d\u5b8c\u6210\uff0c\u5185\u90e8\u788e\u7247\u7387\u4e3a 1 &#8211; \u00a01025 \/ 1280 = 19.9%<\/li>\n<\/ul>\n<p>\u5f97\u76ca\u4e8e PoolSubpage \u76f8\u6bd4\u539f\u6765\u5206\u7ea7\u66f4\u52a0\u7cbe\u7ec6\uff0c\u4ece\u539f\u6765\u7684 2 \u7ea7\u53d8\u6210 38 \u7ea7\uff0c\u5c0f\u5185\u5b58\u5757\u7684\u5206\u914d\u6548\u7387\u5927\u5927\u63d0\u9ad8\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u7136\u540e\u518d\u6765\u770b\u770b\u4e2d\u7b49\u7684\u5185\u5b58\u5757 Normal \uff0828KB\uff0c 4M] \u7684\u5185\u5b58\u5206\u914d\u6548\u7387\u3002\u5047\u8bbe\u4ece\u4e00\u4e2a\u5b8c\u5168\u7a7a\u95f2\u7684 PoolChunk \u7533\u8bf7 2MB + 1KB = 2049KB \u5185\u5b58\uff1a<\/p>\n<ul class=\"list-paddingleft-1\" data-id=\"u00037f9-oWCT12i7\">\n<li data-id=\"ld70c578-H6c2DE2P\">2049KB \u6309\u7167 8KB \u5411\u4e0a\u89c4\u6574\u540e\uff0c\u53d1\u73b0\u9700\u8981 257 \u4e2a Pages\uff1b<\/li>\n<li data-id=\"ld70c578-BCaBXaha\">PoolChunk \u4e2d\u627e\u5230\u6ee1\u8db3\u5927\u5c0f\u7684 Run Run{offset=0, size=512}\uff1b<\/li>\n<li data-id=\"ld70c578-hszfiqVj\">PoolChunk \u5c06 Run \u62c6\u5206\u6210 Run{offset=0, size=257} \u548c Run{offset=257, size=255}\uff0c\u7b2c\u4e00\u4e2a Run \u8fd4\u56de\u7ed9\u8bf7\u6c42\u65b9\uff0c\u7b2c\u4e8c\u4e2a Run \u52a0\u5165\u5230\u7a7a\u95f2 Run \u5217\u8868\uff08runsAvail\uff09\u4e2d\uff1b<\/li>\n<li data-id=\"ld70c578-x9wpgZDj\">\u81f3\u6b64\u5206\u914d\u5b8c\u6210\uff0c\u5185\u90e8\u788e\u7247\u7387\u4e3a 1 &#8211; 2049KB \/ \uff08257 * 8K\uff09 = 0.3%\uff1b<\/li>\n<\/ul>\n<p>\u901a\u8fc7 PageRun \u673a\u5236\uff0cNetty \u53ef\u4ee5\u63a7\u5236\u5927\u4e8e 28KB \u7684\u5185\u5b58\u5757\u5206\u914d\u7684\u5185\u5b58\u6d6a\u8d39\u4e0d\u8d85\u8fc7 8KB\uff0c\u5185\u90e8\u788e\u7247\u7387\u5c0f\u4e8e 22.2%\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u5047\u8bbe\u518d\u7533\u8bf7\u4e00\u4e2a 1MB \u7684\u5185\u5b58\uff0c\u8fd9\u65f6\u5019 PoolChunk \u4ecd\u65e7\u8fd0\u884c\u76f8\u540c\u7684\u903b\u8f91\u5c06 Run{offset=257, size=255} \u62c6\u5206\u6210 Run{offset=257, size=128} \u548c Run{offset=385, size=127}\uff0c\u524d\u8005\u8fd4\u56de\u7ed9\u4e0a\u5c42\uff0c\u540e\u8005\u52a0\u5165\u5230\u7a7a\u95f2 Run \u5217\u8868\u3002\u6b64\u65f6\u5916\u90e8\u788e\u7247\u7387\u4e3a 25%\u3002\u5982\u679c\u6309\u7167\u8001\u7684 Buddy \u7b97\u6cd5\uff0c\u5728 PoolChunk \u7684\u5927\u5c0f\u4e3a 4MB \u7684\u573a\u666f\u4e0b\uff0c\u5c31\u9700\u8981\u65b0\u5f00\u4e00\u4e2a PoolChunk \u4e86\uff0c\u5916\u90e8\u788e\u7247\u7387\u4e3a 62.5%\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u867d\u7136 PageRun\/PoolSubpage \u5206\u914d\u7b97\u6cd5\u5728\u5927\u5c0f\u5185\u5b58\u4e0a\u76f8\u6bd4\u539f\u6709\u7684 Buddy \u5206\u914d\u7b97\u6cd5\u6709\u66f4\u4f4e\u7684\u5185\u90e8\u5185\u5b58\u788e\u7247\u7387\u548c\u5916\u90e8\u5185\u5b58\u788e\u7247\u7387\uff0c\u4f46\u662f\u6bd5\u7adf\u4e0d\u50cf JVM \u5185\u901a\u8fc7 GC \u6765 Compact \u96f6\u6563\u7684\u5185\u5b58\uff0c\u4ecd\u65e7\u4f1a\u51fa\u73b0\u5728\u5404\u79cd\u4e0d\u540c\u5927\u5c0f\u7684\u5185\u5b58\u5757\u6301\u7eed\u7684\u5206\u914d\u91ca\u653e\u573a\u666f\uff0c\u5c06 PoolChunk \u4e2d\u7684\u53ef\u7528 Run \u5207\u5206\u5f88\u96f6\u788e\uff0c\u5185\u5b58\u788e\u7247\u7387\u9010\u6e10\u63d0\u5347\u6700\u7ec8\u5bfc\u81f4 OOM\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>5.AutoMQ \u5e94\u5bf9\u4e4b\u9053<\/h3>\n<p>&nbsp;<\/p>\n<p>\u524d\u9762\u4ecb\u7ecd\u5b8c Netty \u5185\u5b58\u5206\u914d\u7684\u673a\u5236\u548c\u5185\u5b58\u788e\u7247\u4ea7\u751f\u7684\u573a\u666f\uff0c\u90a3 AutoMQ \u80fd\u600e\u4e48\u89e3\u51b3\u5185\u5b58\u788e\u7247\u95ee\u9898\u7684\u5462\uff1f<\/p>\n<p>&nbsp;<\/p>\n<p>LogCache \u9488\u5bf9\u8ffd\u5c3e\u8bfb\u6301\u7eed\u8bbf\u95ee\u65b0\u6570\u636e\u7684\u7279\u70b9\uff0c\u91c7\u7528\u5148\u5165\u5148\u51fa\u7684\u7f13\u5b58\u9a71\u9010\u7b56\u7565\uff0c\u6362\u4e2a\u89d2\u5ea6\u601d\u8003\u5c31\u662f\u5728\u76f8\u90bb\u65f6\u95f4\u5206\u914d\u5185\u5b58\u7684\u4f1a\u5728\u76f8\u90bb\u65f6\u95f4\u91ca\u653e\u3002AutoMQ \u91c7\u7528\u7684\u7b56\u7565\u662f\u62bd\u8c61\u4e00\u4e2a ByteBufSeqAlloc\uff1a<\/p>\n<ul data-id=\"ueafa794-IGXHjn2t\">\n<li data-id=\"ld70c578-dBoAcPwc\">ByteBufSeqAlloc \u6bcf\u6b21\u5411 Netty \u7533\u8bf7 ChunkSize \u5927\u5c0f\u7684 ByteBuf\uff0c\u907f\u514d\u4ea7\u751f\u5916\u90e8\u5185\u5b58\u788e\u7247\uff0c\u505a\u5230\u96f6\u5916\u90e8\u5185\u5b58\u788e\u7247\uff1b<\/li>\n<li data-id=\"ld70c578-dwVZwNT3\">ByteBufSeqAlloc\u5206\u914d\u5185\u5b58\u65f6\uff0c\u901a\u8fc7\u5e95\u5c42 ByteBuf#retainSlice \u7d27\u6328\u7740\u8fde\u7eed\u4ece\u5e95\u5c42\u5927\u7684\u5185\u5b58\u62c6\u5206\u51fa\u5c0f\u7684\u5185\u5b58\uff0c\u907f\u514d size \u89c4\u7ea6\u5316\u4ea7\u751f\u5185\u90e8\u5185\u5b58\u788e\u7247\uff0c\u505a\u5230\u96f6\u5185\u90e8\u5185\u5b58\u788e\u7247\uff1b<\/li>\n<li data-id=\"ld70c578-suoVGcDO\">\u91ca\u653e\u7684\u65f6\u5019\u662f\u76f8\u90bb\u7684\u4e00\u8d77\u91ca\u653e\uff0c\u6709\u53ef\u80fd\u4e00\u5757\u91cc\u9762\u5927\u90e8\u5206\u90fd\u91ca\u653e\u4e86\uff0c\u4f46\u5176\u4e2d\u5c11\u90e8\u5206\u8fd8\u5728\u6709\u6548\u671f\u5185\uff0c\u8fd9\u65f6\u5019\u6574\u4e2a\u5927\u5757\u90fd\u65e0\u6cd5\u91ca\u653e\uff0c\u4f46\u8fd9\u4e2a\u5927\u5757\u7684\u6d6a\u8d39\u6709\u4e14\u4ec5\u4f1a\u5b58\u5728\u4e00\u4e2a\uff0c\u5e76\u4e14\u4e5f\u53ea\u4f1a\u6d6a\u8d39\u4e00\u4e2a ChunkSize \u7684\u5927\u5c0f\uff1b<\/li>\n<\/ul>\n<p>BlockCache \u7684\u7279\u70b9\u662f\u8ffd\u6c42\u51b7\u8bfb\u9ad8\u541e\u5410\uff0c\u4f1a\u4ece\u5bf9\u8c61\u5b58\u50a8\u4e2d\u5927\u5757\u8bfb\u53d6\u6570\u636e\u6bb5\u3002AutoMQ \u91c7\u7528\u7684\u7b56\u7565\u662f\u5927\u5757\u7f13\u5b58\u5bf9\u8c61\u5b58\u50a8\u4e2d\u7684\u539f\u59cb\u6570\u636e\uff1a<\/p>\n<ul data-id=\"ueafa794-FfPchtsq\">\n<li data-id=\"ld70c578-BBmb8Tcj\">\u6309\u9700\u89e3\u7801\uff1a\u7b49\u9700\u8981\u67e5\u8be2\u65f6\uff0c\u518d\u89e3\u7801\u6210\u5177\u4f53\u7684 RecordBatch\uff0c\u901a\u8fc7\u964d\u4f4e\u5e38\u9a7b\u5185\u5b58\u5757\u7684\u6570\u91cf\u6765\u964d\u4f4e\u5185\u5b58\u788e\u7247\uff1b<\/li>\n<li data-id=\"ld70c578-MyNobZR5\">\u89c4\u6574\u5316\u62c6\u5206\uff1a\u672a\u6765\u53ef\u4ee5\u5c06\u5927\u5757\u7f13\u5b58\u89c4\u6574\u5316\u62c6\u5206\u6210\u89c4\u6574\u7684 1MB \u5185\u5b58\u5757\uff0c\u6765\u907f\u514d\u5404\u79cd\u4e0d\u540c\u5927\u5c0f\u7684\u5185\u5b58\u5757\u6301\u7eed\u7684\u5206\u914d\u91ca\u653e\u5bfc\u81f4\u7684\u5185\u5b58\u788e\u7247\u7387\u9010\u6e10\u63d0\u5347\uff1b<\/li>\n<\/ul>\n<p><img decoding=\"async\" title=\"\u56fe\u7247\" src=\"https:\/\/s7.51cto.com\/oss\/202407\/17\/19758749917d8cbc4406529acd1f324743f80f.png\" alt=\"\u56fe\u7247\" data-type=\"block\" \/><span class=\"data-image-title\">\u56fe\u7247<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>\u53ef\u4ee5\u770b\u5230 LogCache \u548c BlockCache \u4f18\u5316\u7684\u672c\u8d28\u90fd\u662f\u6839\u636e\u81ea\u8eab\u7f13\u5b58\u7684\u7279\u70b9\u901a\u8fc7\u5927\u5757 &amp; \u89c4\u6574\u7684\u5185\u5b58\u5206\u914d\u6765\u89c4\u907f Netty \u5185\u5b58\u5206\u914d\u7b56\u7565\u5e26\u6765\u7684\u5185\u5b58\u788e\u7247\u95ee\u9898\u3002\u901a\u8fc7\u8be5\u65b9\u5f0f\uff0cAutoMQ \u5728\u8ffd\u5c3e\u8bfb\u3001\u51b7\u8bfb\u548c\u5927\u5c0f\u6d88\u606f\u7b49\u5404\u79cd\u573a\u666f\u957f\u671f\u8fd0\u884c\uff0c\u4e5f\u80fd\u5c06\u5806\u5916\u5185\u5b58\u7684\u5185\u5b58\u788e\u7247\u7387\u63a7\u5236\u5728 35% \u4ee5\u4e0b\uff0c\u518d\u4e5f\u6ca1\u6709\u51fa\u73b0\u8fc7\u5806\u5916\u5185\u5b58 OOM\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" title=\"\u56fe\u7247\" src=\"https:\/\/s3.51cto.com\/oss\/202407\/17\/79507f85658a790bcd7127525fe20f0abe253b.png\" alt=\"\u56fe\u7247\" data-type=\"block\" \/><span class=\"data-image-title\">\u56fe\u7247<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h3>6.\u603b\u7ed3<\/h3>\n<p>&nbsp;<\/p>\n<p>Netty \u7684 PooledByteBufAllocator \u4e0d\u662f\u94f6\u5f39\uff0c\u4f7f\u7528\u7684\u65f6\u5019\u9700\u8981\u8003\u8651\u5185\u5b58\u788e\u7247\u5e26\u6765\u7684\u5b9e\u9645\u5185\u5b58\u5360\u7528\u7684\u7a7a\u95f4\u653e\u5927\uff0c\u89c4\u5212\u9884\u7559\u51fa\u5408\u7406\u7684 JVM \u5185\u5b58\u5927\u5c0f\u3002\u5982\u679c\u53ea\u662f\u4f7f\u7528 Netty \u4f5c\u4e3a\u7f51\u7edc\u5c42\u6846\u67b6\uff0c\u7531 PooledByteBufAllocator \u5206\u914d\u7684\u5185\u5b58\u751f\u547d\u5468\u671f\u4f1a\u6bd4\u8f83\u77ed\uff0c\u56e0\u6b64\u5185\u5b58\u788e\u7247\u5f15\u8d77\u7684\u5185\u5b58\u653e\u5927\u5b9e\u9645\u5e76\u4e0d\u4f1a\u5f88\u660e\u663e\uff0c\u4e0d\u8fc7\u4ecd\u65e7\u5efa\u8bae\u4f7f\u7528 Netty \u7684\u7cfb\u7edf\u90fd\u5c06\u7248\u672c\u5347\u7ea7\u5230 4.1.52 \u4e4b\u4e0a\uff0c\u4ee5\u83b7\u5f97\u66f4\u597d\u7684\u5185\u5b58\u5206\u914d\u6548\u7387\u3002\u5982\u679c\u4f7f\u7528 Netty \u7684 PooledByteBufAllocator \u6765\u505a\u7f13\u5b58\uff0c\u5efa\u8bae\u6839\u636e\u7f13\u5b58\u7684\u7279\u5f81\uff0c\u4f7f\u7528\u5927\u5757\u5185\u5b58\u5206\u914d\u7136\u540e\u518d\u81ea\u884c\u8fde\u7eed\u62c6\u5206\uff0c\u6765\u89c4\u907f Netty \u7684\u5185\u5b58\u788e\u7247\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h4>\u53c2\u8003\u6587\u6863<\/h4>\n<ol class=\"list-paddingleft-1\" data-id=\"od678705-i6kjBom6\">\n<li data-id=\"ld70c578-33JutdZb\">https:\/\/netty.io\/wiki\/reference-counted-objects.html<\/li>\n<li data-id=\"ld70c578-2Qwz5qt5\">https:\/\/netty.io\/news\/2020\/09\/08\/4-1-52-Final.html<\/li>\n<\/ol>\n<\/div>\n<\/div>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_21212\" class=\"pvc_stats total_only  \" data-element-id=\"21212\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.0\" viewBox=\"0 0 502 315\" preserveAspectRatio=\"xMidYMid meet\"><g transform=\"translate(0,332) scale(0.1,-0.1)\" fill=\"\" stroke=\"none\"><path d=\"M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z\"\/><path d=\"M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z\"\/><path d=\"M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z\"\/><path d=\"M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z\"\/><path d=\"M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z\"\/><path d=\"M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z\"\/><path d=\"M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z\"\/><path d=\"M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z\"\/><path d=\"M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z\"\/><\/g><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/aif.amtbbs.org\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Netty \u7684 PooledByteBufAllocator \u4e0d\u662f\u94f6\u5f39\uff0c\u4f7f\u7528\u7684\u65f6\u5019\u9700\u8981\u8003\u8651\u5185\u5b58\u788e\u7247\u5e26\u6765\u7684\u5b9e\u9645\u5185 [&hellip;]<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_21212\" class=\"pvc_stats total_only  \" data-element-id=\"21212\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.0\" viewBox=\"0 0 502 315\" preserveAspectRatio=\"xMidYMid meet\"><g transform=\"translate(0,332) scale(0.1,-0.1)\" fill=\"\" stroke=\"none\"><path d=\"M2394 3279 l-29 -30 -3 -207 c-2 -182 0 -211 15 -242 39 -76 157 -76 196 0 15 31 17 60 15 243 l-3 209 -33 29 c-26 23 -41 29 -80 29 -41 0 -53 -5 -78 -31z\"\/><path d=\"M3085 3251 c-45 -19 -58 -50 -96 -229 -47 -217 -49 -260 -13 -295 52 -53 146 -42 177 20 16 31 87 366 87 410 0 70 -86 122 -155 94z\"\/><path d=\"M1751 3234 c-13 -9 -29 -31 -37 -50 -12 -29 -10 -49 21 -204 19 -94 39 -189 45 -210 14 -50 54 -80 110 -80 34 0 48 6 76 34 21 21 34 44 34 59 0 14 -18 113 -40 219 -37 178 -43 195 -70 221 -36 32 -101 37 -139 11z\"\/><path d=\"M1163 3073 c-36 -7 -73 -59 -73 -102 0 -56 133 -378 171 -413 34 -32 83 -37 129 -13 70 36 67 87 -16 290 -86 209 -89 214 -129 231 -35 14 -42 15 -82 7z\"\/><path d=\"M3689 3066 c-15 -9 -33 -30 -42 -48 -48 -103 -147 -355 -147 -375 0 -98 131 -148 192 -74 13 15 57 108 97 206 80 196 84 226 37 273 -30 30 -99 39 -137 18z\"\/><path d=\"M583 2784 c-38 -19 -67 -74 -58 -113 9 -42 211 -354 242 -373 16 -10 45 -18 66 -18 51 0 107 52 107 100 0 39 -1 41 -124 234 -80 126 -108 162 -133 173 -41 17 -61 16 -100 -3z\"\/><path d=\"M4250 2784 c-14 -9 -74 -91 -133 -183 -95 -150 -107 -173 -107 -213 0 -55 33 -94 87 -104 67 -13 90 8 211 198 130 202 137 225 78 284 -27 27 -42 34 -72 34 -22 0 -50 -8 -64 -16z\"\/><path d=\"M2275 2693 c-553 -48 -1095 -270 -1585 -649 -135 -104 -459 -423 -483 -476 -23 -49 -22 -139 2 -186 73 -142 361 -457 571 -626 285 -228 642 -407 990 -497 242 -63 336 -73 660 -74 310 0 370 5 595 52 535 111 1045 392 1455 803 122 121 250 273 275 326 19 41 19 137 0 174 -41 79 -309 363 -465 492 -447 370 -946 591 -1479 653 -113 14 -422 18 -536 8z m395 -428 c171 -34 330 -124 456 -258 112 -119 167 -219 211 -378 27 -96 24 -300 -5 -401 -72 -255 -236 -447 -474 -557 -132 -62 -201 -76 -368 -76 -167 0 -236 14 -368 76 -213 98 -373 271 -451 485 -162 444 86 934 547 1084 153 49 292 57 452 25z m909 -232 c222 -123 408 -262 593 -441 76 -74 138 -139 138 -144 0 -16 -233 -242 -330 -319 -155 -123 -309 -223 -461 -299 l-81 -41 32 46 c18 26 49 83 70 128 143 306 141 649 -6 957 -25 52 -61 116 -79 142 l-34 47 45 -20 c26 -10 76 -36 113 -56z m-2057 25 c-40 -58 -105 -190 -130 -263 -110 -324 -59 -707 132 -981 25 -35 42 -64 37 -64 -19 0 -241 119 -326 174 -188 122 -406 314 -532 468 l-58 71 108 103 c185 178 428 349 672 473 66 33 121 60 123 61 2 0 -10 -19 -26 -42z\"\/><path d=\"M2375 1950 c-198 -44 -350 -190 -395 -379 -18 -76 -8 -221 19 -290 114 -284 457 -406 731 -260 98 52 188 154 231 260 27 69 37 214 19 290 -38 163 -166 304 -326 360 -67 23 -215 33 -279 19z\"\/><\/g><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/aif.amtbbs.org\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":56,"featured_media":21214,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23,20,80],"tags":[1212,1213,1214],"class_list":["post-21212","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-23","category-20","category-80","tag-netty","tag-oom","tag-1214"],"_links":{"self":[{"href":"https:\/\/aif.amtbbs.org\/index.php\/wp-json\/wp\/v2\/posts\/21212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aif.amtbbs.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aif.amtbbs.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aif.amtbbs.org\/index.php\/wp-json\/wp\/v2\/users\/56"}],"replies":[{"embeddable":true,"href":"https:\/\/aif.amtbbs.org\/index.php\/wp-json\/wp\/v2\/comments?post=21212"}],"version-history":[{"count":1,"href":"https:\/\/aif.amtbbs.org\/index.php\/wp-json\/wp\/v2\/posts\/21212\/revisions"}],"predecessor-version":[{"id":21215,"href":"https:\/\/aif.amtbbs.org\/index.php\/wp-json\/wp\/v2\/posts\/21212\/revisions\/21215"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aif.amtbbs.org\/index.php\/wp-json\/wp\/v2\/media\/21214"}],"wp:attachment":[{"href":"https:\/\/aif.amtbbs.org\/index.php\/wp-json\/wp\/v2\/media?parent=21212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aif.amtbbs.org\/index.php\/wp-json\/wp\/v2\/categories?post=21212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aif.amtbbs.org\/index.php\/wp-json\/wp\/v2\/tags?post=21212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}