{"id":110570,"date":"2026-09-29T00:56:35","date_gmt":"2026-09-28T16:56:35","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/110570.html"},"modified":"2026-09-29T00:56:35","modified_gmt":"2026-09-28T16:56:35","slug":"%e9%ab%98%e6%80%a7%e8%83%bd%e5%86%85%e5%ad%98%e5%88%86%e9%85%8d%e5%99%a8%e5%86%85%e6%a0%b8%ef%bc%9ajemalloc-%e4%b8%8e-tcmalloc-%e7%ba%bf%e7%a8%8b%e6%9c%ac%e5%9c%b0%e7%bc%93%e5%ad%98%ef%bc%88thread-cac","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/110570.html","title":{"rendered":"\u9ad8\u6027\u80fd\u5185\u5b58\u5206\u914d\u5668\u5185\u6838\uff1aJemalloc \u4e0e TCMalloc \u7ebf\u7a0b\u672c\u5730\u7f13\u5b58\uff08Thread Cache\uff09\u3001Size Class \u4e0e\u5185\u5b58\u788e\u7247\u6cbb\u7406"},"content":{"rendered":"<h2>\u9ad8\u6027\u80fd\u5185\u5b58\u5206\u914d\u5668\u5185\u6838&#xff1a;Jemalloc \u4e0e TCMalloc \u7ebf\u7a0b\u672c\u5730\u7f13\u5b58&#xff08;Thread Cache&#xff09;\u3001Size Class \u4e0e\u5185\u5b58\u788e\u7247\u6cbb\u7406<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260928165634-6aba9c42b06ee.webp\" alt=\"\u5c01\u9762\u4fe1\u606f\u56fe\" \/><\/p>\n<p>\u5728\u73b0\u4ee3\u9ad8\u5e76\u53d1\u5e95\u5c42\u7cfb\u7edf\u5f00\u53d1&#xff08;\u5982 Redis \u9ed8\u8ba4\u91c7\u7528\u7684 Jemalloc\u3001Google Chrome \u4e0e Go \u8bed\u8a00\u5e95\u5c42\u91c7\u7528\u7684 TCMalloc&#xff0c;\u4ee5\u53ca Java Netty \u9ed8\u8ba4\u4f7f\u7528\u7684 PooledByteBufAllocator&#xff09;\u4e2d&#xff0c;\u201c\u5185\u5b58\u5206\u914d\u5668&#xff08;Memory Allocator&#xff09;\u201d \u662f\u652f\u914d\u6574\u4e2a\u7cfb\u7edf\u541e\u5410\u4e0e\u5185\u5b58\u5229\u7528\u7387\u7684\u6700\u6838\u5fc3\u5e95\u5c42\u5f15\u64ce\u3002<\/p>\n<p>\u6807\u51c6\u7684 glibc ptmalloc \u5728\u591a\u6838\u9ad8\u5e76\u53d1\u573a\u666f\u4e0b&#xff0c;\u5b58\u5728\u4e24\u5927\u65e0\u6cd5\u5fcd\u53d7\u7684\u81f4\u547d\u7f3a\u9677&#xff1a;<\/p>\n<li>\u5168\u5c40 Arena \u9501\u7ade\u4e89&#xff08;Lock Contention&#xff09;&#xff1a;\u6570\u5341\u4e2a\u7ebf\u7a0b\u5e76\u53d1\u8c03\u7528 malloc() \u548c free() \u65f6&#xff0c;\u9891\u7e41\u4e89\u62a2\u5168\u5c40\u4e92\u65a5\u9501&#xff0c;\u591a\u6838 CPU \u7b97\u529b\u51e0\u4e4e\u5168\u88ab\u9501\u81ea\u65cb\u7a7a\u8017&#xff1b;<\/li>\n<li>\u4e25\u91cd\u7684\u5185\u5b58\u788e\u7247&#xff08;Memory Fragmentation&#xff09;&#xff1a;\u9891\u7e41\u7533\u8bf7\u548c\u91ca\u653e\u4e0d\u540c\u5927\u5c0f\u7684\u4e34\u65f6\u5c0f\u5bf9\u8c61&#xff0c;\u5bfc\u81f4\u7269\u7406\u5185\u5b58\u4e2d\u5e03\u6ee1\u4e86\u65e0\u6cd5\u88ab\u5408\u5e76\u7684\u5fae\u5c0f\u5b54\u6d1e&#xff0c;\u8fdb\u7a0b\u7269\u7406\u5185\u5b58&#xff08;RSS&#xff09;\u6301\u7eed\u81a8\u80c0&#xff0c;\u6700\u7ec8\u5f15\u53d1\u7cfb\u7edf OOM \u5d29\u6e83\u3002<\/li>\n<p>Jemalloc&#xff08;Jason Evans&#039; Malloc&#xff09; \u4e0e TCMalloc&#xff08;Thread-Caching Malloc&#xff09; \u521b\u9020\u6027\u5730\u901a\u8fc7 \u201c\u7ebf\u7a0b\u672c\u5730\u65e0\u9501\u7f13\u5b58&#xff08;Thread Cache&#xff0c;tcache&#xff09;\u201d\u3001\u201c\u5b9a\u957f\u89c4\u683c\u5206\u7c7b&#xff08;Size Classes&#xff09;\u201d \u4e0e \u201c\u5206\u5c42 Arena \u67b6\u6784\u201d&#xff0c;\u5b9e\u73b0\u4e86 \u7eb3\u79d2\u7ea7\u96f6\u9501\u5206\u914d\u4e0e\u4f4e\u4e8e 5% \u7684\u6781\u81f4\u5185\u5b58\u788e\u7247\u7387&#xff01;<\/p>\n<p>\u4eca\u5929\u6211\u4eec\u6df1\u5165\u4e24\u5927\u9ad8\u6027\u80fd\u5206\u914d\u5668\u7684\u5e95\u5c42\u5185\u6838\u67b6\u6784&#xff0c;\u628a\u5185\u5b58\u5206\u7ea7\u5206\u914d\u6d41\u7a0b\u3001\u4f19\u4f34\u7cfb\u7edf\u4e0e\u56de\u6536\u81ea\u6108\u65f6\u5e8f\u5f7b\u5e95\u8bb2\u900f\u3002<\/p>\n<hr \/>\n<h4>Jemalloc \/ TCMalloc \u6838\u5fc3\u5206\u5c42\u67b6\u6784\u5168\u666f\u62d3\u6251\u56fe<\/h4>\n<p>graph TD<br \/>\n    App[\u5e94\u7528\u7a0b\u5e8f\u7ebf\u7a0b\u8c03\u7528 malloc(size)] &#8211;&gt; CheckSize{\u6839\u636e size \u5f52\u7c7b\u5230 Size Class}<\/p>\n<p>    CheckSize &#8211;&gt; Small[1. \u5c0f\u5bf9\u8c61 Small Alloc (&lt;&#061; 14KB\/32KB)]<br \/>\n    Small &#8211;&gt; TCache{\u67e5\u7ebf\u7a0b\u672c\u5730\u79c1\u6709\u7f13\u5b58 tcache \/ ThreadCache}<br \/>\n    TCache &#8211;&gt;|\u547d\u4e2d! (\u5355\u7ebf\u7a0b\u72ec\u5360, \u4e25\u683c 0 \u9501\u4e89\u7528!)| FastReturn[&#x1f525; 3 \u7eb3\u79d2\u6781\u901f\u8fd4\u56de\u5185\u5b58\u6307\u9488!]<\/p>\n<p>    TCache &#8211;&gt;|\u672a\u547d\u4e2d (\u672c\u5730\u7a7a\u76d8)| Arena[2. \u6279\u91cf\u5411\u6240\u5c5e Arena \/ CentralFreeList \u6279\u53d1\u4e00\u6279\u5185\u5b58\u5757 (\u52a0\u7ec6\u7c92\u5ea6\u5206\u7247\u9501)]<br \/>\n    Arena &#8211;&gt; Extent[3. \u82e5 Arena \u4e5f\u4e0d\u8db3: \u5411 Extents \/ PageHeap \u7533\u8bf7\u5927\u7269\u7406\u9875]<\/p>\n<p>    CheckSize &#8211;&gt; Large[2. \u5927\u5bf9\u8c61 Large Alloc (32KB ~ 4MB)]<br \/>\n    Large &#8211;&gt; Arena<\/p>\n<p>    CheckSize &#8211;&gt; Huge[3. \u5de8\u578b\u5bf9\u8c61 Huge Alloc (&gt; 4MB)]<br \/>\n    Huge &#8211;&gt; DirectOS[\u76f4\u63a5\u901a\u8fc7 mmap() \u5411\u64cd\u4f5c\u7cfb\u7edf\u7533\u8bf7\u72ec\u7acb\u5927\u865a\u62df\u5185\u5b58\u6620\u5c04]<\/p>\n<hr \/>\n<h4>\u4e00\u3001\u6838\u5fc3\u652f\u67f1\u4e00&#xff1a;\u7ebf\u7a0b\u672c\u5730\u65e0\u9501\u7f13\u5b58&#xff08;Thread Cache&#xff0c;tcache&#xff09;<\/h4>\n<h5>\u4e3a\u4ec0\u4e48\u5b83\u80fd\u6d88\u706d 95% \u7684\u9501\u7ade\u4e89&#xff1f;<\/h5>\n<p>\u5728\u591a\u6838\u591a\u7ebf\u7a0b\u7cfb\u7edf\u4e2d&#xff0c;\u7edd\u5927\u591a\u6570\u7684\u5185\u5b58\u5206\u914d\u90fd\u662f**\u201c\u4e34\u65f6\u3001\u9891\u7e41\u7684\u5c0f\u5bf9\u8c61&#xff08;\u5982 32 \u5b57\u8282\u300164 \u5b57\u8282\u3001128 \u5b57\u8282&#xff09;\u201d**\u3002Jemalloc \u4e3a\u6bcf\u4e00\u4e2a\u7ebf\u7a0b\u5206\u914d\u4e86\u4e00\u4e2a\u79c1\u6709\u7684 tcache&#xff08;Thread Local Cache&#xff09;&#xff1a;<\/p>\n<ul>\n<li>\u7ebf\u7a0b\u5728\u7533\u8bf7\u5c0f\u5bf9\u8c61\u65f6&#xff0c;\u76f4\u63a5\u4ece\u81ea\u5df1\u7684 tcache \u5355\u94fe\u8868\u4e2d\u5f39\u51fa\u4e00\u4e2a\u7a7a\u95f2\u69fd\u4f4d&#xff08;Pop&#xff09;&#xff1b;<\/li>\n<li>\u91ca\u653e\u5185\u5b58\u65f6&#xff0c;\u76f4\u63a5\u538b\u5165\u81ea\u5df1\u7684 tcache \u6808\u9876&#xff08;Push&#xff09;&#xff1b;<\/li>\n<li>\u5168\u7a0b\u5b8c\u5168\u4e0d\u9700\u8981\u4efb\u4f55\u4e92\u65a5\u9501&#xff0c;\u4e5f\u4e0d\u9700\u8981 CAS \u539f\u5b50\u64cd\u4f5c&#xff01;\u5355\u6b21\u5206\u914d\u8017\u65f6\u4ec5\u9700 3~5 \u4e2a\u65f6\u949f\u5468\u671f&#xff08;\u7ea6 3 \u7eb3\u79d2&#xff09;&#xff01;<\/li>\n<\/ul>\n<hr \/>\n<h4>\u4e8c\u3001\u6838\u5fc3\u652f\u67f1\u4e8c&#xff1a;\u5b9a\u957f\u89c4\u683c\u5206\u7c7b&#xff08;Size Classes&#xff09;\u6d88\u706d\u5916\u90e8\u5185\u5b58\u788e\u7247<\/h4>\n<p>\u4f20\u7edf\u7684\u7a7a\u95f2\u94fe\u8868\u5206\u914d&#xff08;\u5982 First-Fit\u3001Best-Fit&#xff09;\u4f1a\u6839\u636e\u7528\u6237\u8bf7\u6c42\u7684\u4efb\u610f\u5b57\u8282\u6570&#xff08;\u5982 37 \u5b57\u8282\u300191 \u5b57\u8282&#xff09;\u5728\u5185\u5b58\u4e2d\u968f\u610f\u5207\u5272&#xff0c;\u968f\u7740\u65f6\u95f4\u63a8\u79fb\u4ea7\u751f\u6d77\u91cf\u5916\u90e8\u788e\u7247\u3002<\/p>\n<h5>Jemalloc \u7684\u5b9a\u957f\u89c4\u6574\u5206\u7c7b&#xff08;Size Classes&#xff09;&#xff1a;<\/h5>\n<p>Jemalloc \u4e25\u7981\u968f\u610f\u5207\u5272\u5185\u5b58&#xff0c;\u5c06\u6240\u6709\u5185\u5b58\u8bf7\u6c42\u4e25\u683c\u5411\u4e0a\u53d6\u6574&#xff08;Round Up&#xff09; \u5bf9\u9f50\u5230\u79bb\u6563\u7684\u56fa\u5b9a\u89c4\u683c&#xff08;Size Classes&#xff09;\u4e2d&#xff1a;<\/p>\n<p>Jemalloc Size Classes \u9636\u68af\u8868 (\u5171 200&#043; \u4e2a\u7cbe\u7ec6\u89c4\u683c)&#xff1a;<br \/>\n  * Small Tiny \u89c4\u683c: 8B, 16B, 32B, 48B, 64B, 80B, 96B, 112B, 128B<br \/>\n  * Small Quantum \u89c4\u683c: 160B, 192B, 224B, 256B, 320B, 384B, 448B, 512B &#8230;<br \/>\n  * Large \u89c4\u683c: 16KB, 32KB, 64KB, 128KB, 256KB, 512KB, 1MB, 2MB, 4MB<\/p>\n<ul>\n<li>\u7269\u7406\u6536\u76ca&#xff1a;\u82e5\u7528\u6237\u8bf7\u6c42\u5206\u914d 35 \u5b57\u8282&#xff0c;\u7cfb\u7edf\u7edf\u4e00\u5206\u914d 48 \u5b57\u8282\u7684\u69fd\u4f4d&#xff1b;\u867d\u7136\u727a\u7272\u4e86\u5fae\u5c0f\u7684\u5185\u90e8\u788e\u7247&#xff08;13 \u5b57\u8282&#xff09;&#xff0c;\u4f46\u6240\u6709\u76f8\u540c\u89c4\u683c\u7684\u5185\u5b58\u5757\u5728\u7269\u7406\u4e0a\u6574\u9f50\u5212\u4e00&#xff0c;\u91ca\u653e\u540e\u53ef\u4ee5\u88ab\u540e\u7eed\u4efb\u610f\u540c\u89c4\u683c\u8bf7\u6c42 100% \u5b8c\u7f8e\u590d\u7528&#xff0c;\u5f7b\u5e95\u6d88\u9664\u4e86\u7834\u574f\u6027\u7684\u5916\u90e8\u788e\u7247&#xff01;<\/li>\n<\/ul>\n<hr \/>\n<h4>\u4e09\u3001\u6838\u5fc3\u652f\u67f1\u4e09&#xff1a;\u5206\u7247 Arena \u67b6\u6784\u4e0e\u6279\u91cf\u586b\u5145&#xff08;Chunk Filling&#xff09;<\/h4>\n<p>\u5f53\u67d0\u4e2a\u7ebf\u7a0b\u7684 tcache \u4e2d\u7684 64 \u5b57\u8282\u69fd\u4f4d\u8017\u5c3d\u65f6&#xff1a;<\/p>\n<ul>\n<li>\u7ebf\u7a0b\u4e0d\u4f1a\u4e00\u6b21\u53ea\u5411\u5e95\u5c42\u7533\u8bf7 1 \u4e2a\u5bf9\u8c61&#xff0c;\u800c\u662f\u4e00\u6b21\u6027\u5411\u5176\u7ed1\u5b9a\u7684 Arena\u201c\u6279\u53d1\u201d\u4e00\u5927\u6279&#xff08;\u5982 64 \u4e2a&#xff09;\u8fde\u7eed\u7684\u5185\u5b58\u5757\u586b\u5145\u8fdb tcache&#xff08;Batch Filling&#xff09;&#xff1b;<\/li>\n<li>\u5206\u7247 Arena&#xff08;Sharded Arenas&#xff09;&#xff1a;Jemalloc \u9ed8\u8ba4\u6839\u636e CPU \u6838\u5fc3\u6570\u521b\u5efa $4 \\\\times N_{\\\\text{cores}}$ \u4e2a\u72ec\u7acb\u7684 Arena\u3002\u5404\u4e2a\u7ebf\u7a0b\u901a\u8fc7\u54c8\u5e0c\u6563\u5217\u7ed1\u5b9a\u5230\u4e0d\u540c\u7684 Arena \u4e0a&#xff0c;\u5373\u4f7f\u5411\u5e95\u5c42\u6279\u53d1\u5185\u5b58&#xff0c;\u4e0d\u540c\u6838\u5fc3\u4e4b\u95f4\u7684\u9501\u51b2\u7a81\u6982\u7387\u4e5f\u88ab\u7a00\u91ca\u4e86\u6570\u5341\u500d&#xff01;<\/li>\n<\/ul>\n<hr \/>\n<h4>\u56db\u3001Netty PooledByteBufAllocator \u5bf9 Jemalloc \u7684\u7ecf\u5178\u5de5\u7a0b\u590d\u523b<\/h4>\n<p>Java Netty \u6846\u67b6\u7684\u9ad8\u6027\u80fd\u5806\u5916\u76f4\u63a5\u5185\u5b58\u6c60&#xff0c;\u5728\u67b6\u6784\u8bbe\u8ba1\u4e0a 100% \u6df1\u5ea6\u501f\u9274\u5e76\u590d\u523b\u4e86 Jemalloc \u7684\u67b6\u6784\u601d\u60f3&#xff1a;<\/p>\n<p>graph LR<br \/>\n    subgraph Netty \u5185\u5b58\u6c60\u5c42\u6b21\u7ed3\u6784 (Jemalloc Java \u590d\u523b\u7248)<br \/>\n        PoolThreadCache[PoolThreadCache: \u7ebf\u7a0b\u79c1\u6709\u65e0\u9501\u7f13\u5b58] &#8211;&gt; PoolArena[PoolArena: \u5206\u7247\u533a\u57df (DirectArena \/ HeapArena)]<br \/>\n        PoolArena &#8211;&gt; PoolChunkList[PoolChunkList: \u7ba1\u7406 16MB \u7684\u5927 Chunk]<br \/>\n        PoolChunkList &#8211;&gt; PoolChunk[PoolChunk: \u91c7\u7528\u5b8c\u5168\u4e8c\u53c9\u6811\u4f19\u4f34\u7b97\u6cd5 Buddy Allocation]<br \/>\n        PoolChunk &#8211;&gt; PoolSubpage[PoolSubpage: \u5c06 8KB Page \u5207\u5206\u4e3a\u7cbe\u7ec6\u7684 Tiny\/Small \u69fd\u4f4d]<br \/>\n    end<\/p>\n<h5>Netty \u5185\u5b58\u6c60\u5206\u914d\u6781\u901f\u4ee3\u7801&#xff1a;<\/h5>\n<p>\/\/ \u4ece Jemalloc \u601d\u60f3\u7684\u76f4\u63a5\u5185\u5b58\u6c60\u4e2d\u5206\u914d 256 \u5b57\u8282<br \/>\nByteBuf buf &#061; PooledByteBufAllocator.DEFAULT.directBuffer(256);<br \/>\ntry {<br \/>\n    \/\/ \u4e1a\u52a1\u6781\u901f\u8bfb\u5199<br \/>\n} finally {<br \/>\n    \/\/ \u91ca\u653e\u65f6\u76f4\u63a5\u5f52\u8fd8\u56de\u5f53\u524d\u7ebf\u7a0b\u7684 PoolThreadCache, \u96f6\u7cfb\u7edf\u8c03\u7528\u4e0e\u96f6 GC \u5783\u573e!<br \/>\n    buf.release();<br \/>\n}<\/p>\n<hr \/>\n<h4>\u5185\u5b58\u5206\u914d\u5668\u6027\u80fd\u5168\u666f\u5bf9\u6bd4\u77e9\u9635<\/h4>\n<table>\n<tr>\u5185\u5b58\u5206\u914d\u5668\u591a\u7ebf\u7a0b\u5e76\u53d1\u6027\u80fd\u5185\u5b58\u788e\u7247\u6cbb\u7406\u80fd\u529b\u7f13\u5b58\u5c40\u90e8\u6027\u5178\u578b\u5de5\u4e1a\u7ea7\u6807\u6746\u5e94\u7528<\/tr>\n<tbody>\n<tr>\n<td>glibc ptmalloc<\/td>\n<td>\u8f83\u5dee&#xff08;\u591a\u6838\u4e25\u91cd\u9501\u7ade\u4e89&#xff09;<\/td>\n<td>\u8f83\u5dee&#xff08;\u957f\u671f\u8fd0\u884c\u6613\u5185\u5b58\u6cc4\u6f0f\u5f0f\u81a8\u80c0&#xff09;<\/td>\n<td>\u4e2d\u7b49<\/td>\n<td>Linux \u9ed8\u8ba4\u6807\u51c6\u5e93<\/td>\n<\/tr>\n<tr>\n<td>Google TCMalloc<\/td>\n<td>\u6781\u9ad8&#xff08;ThreadCache \u65e0\u9501&#xff09;<\/td>\n<td>\u6781\u4f73<\/td>\n<td>\u6781\u4f73<\/td>\n<td>Google Chrome\u3001Go \u8fd0\u884c\u65f6\u5185\u5b58\u5206\u914d\u5668<\/td>\n<\/tr>\n<tr>\n<td>Jemalloc<\/td>\n<td>\u6781\u81f4&#xff08;Sharded Arena &#043; tcache&#xff09;<\/td>\n<td>\u6700\u5f3a&#xff08;Extents \u6811\u5f62\u7cbe\u7ec6\u5408\u5e76&#xff09;<\/td>\n<td>\u6781\u4f73<\/td>\n<td>Redis \u9ed8\u8ba4\u5206\u914d\u5668\u3001FreeBSD\u3001Netty<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h4>\u5b9e\u4e60\u751f\u7684\u4f53\u7cfb\u7ed3\u6784\u603b\u7ed3<\/h4>\n<p>\u9ad8\u6027\u80fd\u5185\u5b58\u5206\u914d\u5668\u662f\u73b0\u4ee3\u8ba1\u7b97\u673a\u5e95\u5c42\u8f6f\u4ef6\u5de5\u7a0b\u4e2d\u6700\u7cbe\u5bc6\u3001\u6700\u4f18\u96c5\u7684\u201c\u7a7a\u95f4\u4e0e\u65f6\u95f4\u5e73\u8861\u827a\u672f\u201d\u3002\u5b83\u7528\u7ebf\u7a0b\u79c1\u6709\u7f13\u5b58&#xff08;tcache&#xff09;\u6218\u80dc\u4e86\u9501\u4e89\u7528&#xff0c;\u7528\u79bb\u6563\u89c4\u683c&#xff08;Size Classes&#xff09;\u6d88\u706d\u4e86\u788e\u7247\u9ed1\u6d1e&#xff0c;\u7528\u6279\u91cf\u6279\u53d1\u4e0e\u5206\u7247 Arena \u5f81\u670d\u4e86\u591a\u6838\u541e\u5410\u3002\u6df1\u523b\u7406\u89e3 Jemalloc \u4e0e TCMalloc \u7684\u5185\u6838\u67b6\u6784&#xff0c;\u4e0d\u4ec5\u4e3a\u4f60\u6253\u5f00\u4e86\u9ad8\u6027\u80fd C\/C&#043;&#043; \u8c03\u4f18\u7684\u5927\u95e8&#xff0c;\u66f4\u4e3a\u4f60\u5728 Java \u5806\u5916\u5185\u5b58\u4e0e\u9ad8\u5e76\u53d1\u67b6\u6784\u8bbe\u8ba1\u4e2d\u63d0\u4f9b\u4e86\u6c38\u6052\u7684\u67b6\u6784\u7075\u611f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9ad8\u6027\u80fd\u5185\u5b58\u5206\u914d\u5668\u5185\u6838&#xff1a;Jemalloc \u4e0e TCMalloc \u7ebf\u7a0b\u672c\u5730\u7f13\u5b58&#xff08;Thread Cache&#xff09;\u3001Size Class \u4e0e\u5185\u5b58\u788e\u7247\u6cbb\u7406\u5728\u73b0\u4ee3\u9ad8\u5e76\u53d1\u5e95\u5c42\u7cfb\u7edf\u5f00\u53d1&#xff08;\u5982 Redis \u9ed8\u8ba4\u91c7\u7528\u7684 Jemalloc\u3001Google Chrome \u4e0e Go \u8bed\u8a00\u5e95\u5c42\u91c7\u7528\u7684 TCMalloc&#xff0c;\u4ee5\u53ca Java Netty \u9ed8\u8ba4\u4f7f\u7528\u7684 PooledByteBufAllocator&#xff09;\u4e2d&#xff0c;\u201c\u5185\u5b58\u5206<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[66,2692,50,4323,427],"topic":[],"class_list":["post-110570","post","type-post","status-publish","format-standard","hentry","category-server","tag-ai","tag-leetcode","tag-50","tag-4323","tag-427"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u9ad8\u6027\u80fd\u5185\u5b58\u5206\u914d\u5668\u5185\u6838\uff1aJemalloc \u4e0e TCMalloc \u7ebf\u7a0b\u672c\u5730\u7f13\u5b58\uff08Thread Cache\uff09\u3001Size Class \u4e0e\u5185\u5b58\u788e\u7247\u6cbb\u7406 - \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\/110570.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u9ad8\u6027\u80fd\u5185\u5b58\u5206\u914d\u5668\u5185\u6838\uff1aJemalloc \u4e0e TCMalloc \u7ebf\u7a0b\u672c\u5730\u7f13\u5b58\uff08Thread Cache\uff09\u3001Size Class \u4e0e\u5185\u5b58\u788e\u7247\u6cbb\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u9ad8\u6027\u80fd\u5185\u5b58\u5206\u914d\u5668\u5185\u6838&#xff1a;Jemalloc \u4e0e TCMalloc \u7ebf\u7a0b\u672c\u5730\u7f13\u5b58&#xff08;Thread Cache&#xff09;\u3001Size Class \u4e0e\u5185\u5b58\u788e\u7247\u6cbb\u7406\u5728\u73b0\u4ee3\u9ad8\u5e76\u53d1\u5e95\u5c42\u7cfb\u7edf\u5f00\u53d1&#xff08;\u5982 Redis \u9ed8\u8ba4\u91c7\u7528\u7684 Jemalloc\u3001Google Chrome \u4e0e Go \u8bed\u8a00\u5e95\u5c42\u91c7\u7528\u7684 TCMalloc&#xff0c;\u4ee5\u53ca Java Netty \u9ed8\u8ba4\u4f7f\u7528\u7684 PooledByteBufAllocator&#xff09;\u4e2d&#xff0c;\u201c\u5185\u5b58\u5206\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/110570.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-28T16:56:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260928165634-6aba9c42b06ee.webp\" \/>\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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/110570.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/110570.html\",\"name\":\"\u9ad8\u6027\u80fd\u5185\u5b58\u5206\u914d\u5668\u5185\u6838\uff1aJemalloc \u4e0e TCMalloc \u7ebf\u7a0b\u672c\u5730\u7f13\u5b58\uff08Thread Cache\uff09\u3001Size Class \u4e0e\u5185\u5b58\u788e\u7247\u6cbb\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-28T16:56:35+00:00\",\"dateModified\":\"2026-09-28T16:56:35+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/110570.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/110570.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/110570.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u9ad8\u6027\u80fd\u5185\u5b58\u5206\u914d\u5668\u5185\u6838\uff1aJemalloc \u4e0e TCMalloc \u7ebf\u7a0b\u672c\u5730\u7f13\u5b58\uff08Thread Cache\uff09\u3001Size Class \u4e0e\u5185\u5b58\u788e\u7247\u6cbb\u7406\"}]},{\"@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":"\u9ad8\u6027\u80fd\u5185\u5b58\u5206\u914d\u5668\u5185\u6838\uff1aJemalloc \u4e0e TCMalloc \u7ebf\u7a0b\u672c\u5730\u7f13\u5b58\uff08Thread Cache\uff09\u3001Size Class \u4e0e\u5185\u5b58\u788e\u7247\u6cbb\u7406 - \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\/110570.html","og_locale":"zh_CN","og_type":"article","og_title":"\u9ad8\u6027\u80fd\u5185\u5b58\u5206\u914d\u5668\u5185\u6838\uff1aJemalloc \u4e0e TCMalloc \u7ebf\u7a0b\u672c\u5730\u7f13\u5b58\uff08Thread Cache\uff09\u3001Size Class \u4e0e\u5185\u5b58\u788e\u7247\u6cbb\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u9ad8\u6027\u80fd\u5185\u5b58\u5206\u914d\u5668\u5185\u6838&#xff1a;Jemalloc \u4e0e TCMalloc \u7ebf\u7a0b\u672c\u5730\u7f13\u5b58&#xff08;Thread Cache&#xff09;\u3001Size Class \u4e0e\u5185\u5b58\u788e\u7247\u6cbb\u7406\u5728\u73b0\u4ee3\u9ad8\u5e76\u53d1\u5e95\u5c42\u7cfb\u7edf\u5f00\u53d1&#xff08;\u5982 Redis \u9ed8\u8ba4\u91c7\u7528\u7684 Jemalloc\u3001Google Chrome \u4e0e Go \u8bed\u8a00\u5e95\u5c42\u91c7\u7528\u7684 TCMalloc&#xff0c;\u4ee5\u53ca Java Netty \u9ed8\u8ba4\u4f7f\u7528\u7684 PooledByteBufAllocator&#xff09;\u4e2d&#xff0c;\u201c\u5185\u5b58\u5206","og_url":"https:\/\/www.wsisp.com\/helps\/110570.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-28T16:56:35+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260928165634-6aba9c42b06ee.webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/110570.html","url":"https:\/\/www.wsisp.com\/helps\/110570.html","name":"\u9ad8\u6027\u80fd\u5185\u5b58\u5206\u914d\u5668\u5185\u6838\uff1aJemalloc \u4e0e TCMalloc \u7ebf\u7a0b\u672c\u5730\u7f13\u5b58\uff08Thread Cache\uff09\u3001Size Class \u4e0e\u5185\u5b58\u788e\u7247\u6cbb\u7406 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-28T16:56:35+00:00","dateModified":"2026-09-28T16:56:35+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/110570.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/110570.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/110570.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u9ad8\u6027\u80fd\u5185\u5b58\u5206\u914d\u5668\u5185\u6838\uff1aJemalloc \u4e0e TCMalloc \u7ebf\u7a0b\u672c\u5730\u7f13\u5b58\uff08Thread Cache\uff09\u3001Size Class \u4e0e\u5185\u5b58\u788e\u7247\u6cbb\u7406"}]},{"@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\/110570","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=110570"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/110570\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=110570"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=110570"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=110570"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=110570"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}