{"id":87280,"date":"2020-05-02T09:05:50","date_gmt":"2020-05-02T01:05:50","guid":{"rendered":"http:\/\/4563.org\/?p=87280"},"modified":"2020-05-02T09:05:50","modified_gmt":"2020-05-02T01:05:50","slug":"%e8%af%91-%ef%bd%83%e7%a8%8b%e5%ba%8f%e5%91%98%e8%af%a5%e7%9f%a5%e9%81%93%e7%9a%84%e5%86%85%e5%ad%98%e7%9f%a5%e8%af%86-1","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=87280","title":{"rendered":"[\u8bd1] \uff23\u7a0b\u5e8f\u5458\u8be5\u77e5\u9053\u7684\u5185\u5b58\u77e5\u8bc6 (1)"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  [\u8bd1] \uff23\u7a0b\u5e8f\u5458\u8be5\u77e5\u9053\u7684\u5185\u5b58\u77e5\u8bc6 (1)               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : felix021 <\/span>  <span><i><\/i> 12<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u4e0a\u7bc7 \u300a\u8e29\u5751\u8bb0\uff1ago \u670d\u52a1\u5185\u5b58\u66b4\u6da8\u300b\u8fd8\u633a\u53d7\u6b22\u8fce\u7684\u3002\u5c3d\u7ba1\u6587\u4e2d\u7684\u6838\u5fc3\u5185\u5bb9\u5f88\u5c11\uff0c\u4f46\u662f\u4e3a\u4e86\u8ba9\u5927\u591a\u6570\u4eba\u80fd\u8bfb\u61c2\uff0c\u4e2d\u95f4\u82b1\u4e86\u5f88\u5927\u7684\u7bc7\u5e45\u6765\u89e3\u91ca\u3002<\/p>\n<p>\u5c3d\u7ba1\u5982\u6b64\uff0c\u6211\u4ecd\u7136\u89c9\u5f97\u8bb2\u5f97\u4e0d\u591f\u900f\uff0c\u601d\u6765\u60f3\u53bb\u89c9\u5f97\u8fd8\u662f\u6587\u4e2d\u63d0\u5230\u7684\u300a What a C programmer should know about memory \u300b[1]\u8bb2\u5f97\u597d\uff0c\u60f3\u501f\u7740\u5047\u671f\u7ffb\u8bd1\u4e00\u4e0b\uff0c\u4e5f\u501f\u673a\u518d\u5b66\u4e60\u4e00\u904d\uff08\u987a\u4fbf\u7ec3\u4e60\u82f1\u6587\uff09\u3002<\/p>\n<p>\u5185\u5bb9\u6709\u70b9\u957f\uff0c\u6211\u4f1a\u5206\u6210\u51e0\u7bc7\u3002<\/p>\n<p>\u4ee5\u4e0b\u662f\u6b63\u6587\u3002<\/p>\n<h1>C \u7a0b\u5e8f\u5458\u5e94\u8be5\u77e5\u9053\u7684\u5185\u5b58\u77e5\u8bc6<\/h1>\n<p> <\/p>\n<p>2007 \u5e74\uff0cUlrich Drepper \u5927\u4f6c\u5199\u4e86\u4e00\u7bc7\u201c\u6bcf\u4e2a\u7a0b\u5e8f\u5458\u90fd\u5e94\u8be5\u77e5\u9053\u7684\u5185\u5b58\u77e5\u8bc6\u201d[2]\uff0c\u7279\u522b\u957f\uff0c\u4f46\u5e72\u8d27\u6ee1\u6ee1\u3002<\/p>\n<p>\u4f46\u8fc7\u53bb\u4e86\u8fd9\u4e48\u591a\u5e74\uff08\u8bd1\u6ce8\uff1a\u539f\u6587\u5199\u4e8e 2015 \u5e74 2 \u6708\uff09\uff0c\u201c\u865a\u62df\u5185\u5b58\u201d\u8fd9\u4e2a\u6982\u5ff5\u5bf9\u5f88\u591a\u4eba\u4f9d\u7136\u5f88\u8ff7\uff0c\u5c31\u50cf<em>\u67d0\u79cd\u9b54\u6cd5<\/em>\u3002\u5443\uff0c\u5b9e\u5728\u662f\u5fcd\u4e0d\u4f4f\u5f15\u7528\u4e00\u4e0b\uff08\u8bd1\u6ce8\uff1a\u5e94\u8be5\u662f\u6307\u7687\u540e\u4e50\u961f\u7684 A Kind of Magic \uff09\u3002<\/p>\n<p>\u5373\u4f7f\u662f\u8be5\u6587\u7684\u6b63\u786e\u6027\uff0c\u8fd9\u4e48\u591a\u5e74\u4ee5\u540e\u4ecd\u7136\u88ab\u8d28\u7591[3]\uff08\u8bd1\u6ce8\uff1a\u6709\u4eba\u5728 stackoverflow \u4e0a\u63d0\u95ee\u6587\u4e2d\u5185\u5bb9\u6709\u591a\u5c11\u8fd8\u6709\u6548\uff09\u3002<em>\u51fa\u4e86\u4ec0\u4e48\u4e8b\uff1f<\/em><\/p>\n<blockquote>\n<p><em>\u5317\u6865\uff1f\u8fd9\u662f\u4ec0\u4e48\u9b3c\uff1f\u8fd9\u53ef\u4e0d\u662f\u8857\u5934\u68b0\u6597\u3002<\/em><\/p>\n<\/blockquote>\n<p>\uff08\u8bd1\u6ce8\uff1a\u5317\u6865\u662f\u65e9\u5e74\u7535\u8111\u4e3b\u677f\u4e0a\u7684\u91cd\u8981\u82af\u7247\uff0c\u7528\u6765\u5904\u7406\u6765\u81ea CPU \u3001\u5185\u5b58\u7b49\u8bbe\u5907\u7684\u9ad8\u901f\u4fe1\u53f7\uff09<\/p>\n<p>\u6211\u4f1a\u8bd5\u7740\u5c55\u73b0\u5b66\u4e60\u8fd9\u4e9b\u77e5\u8bc6\u7684\u5b9e\u7528\u6027\uff08\u5373\u4f60\u53ef\u4ee5\u505a\u4ec0\u4e48\uff09\uff0c\u5305\u62ec\u201c\u5b66\u4e60\u9501\u7684\u57fa\u672c\u539f\u7406\u201d\uff0c\u548c\u66f4\u591a\u6709\u8da3\u7684\u4e1c\u897f\u3002\u4f60\u53ef\u4ee5\u628a\u8fd9\u5f53\u6210\u90a3\u7bc7\u6587\u7ae0\u548c\u4f60\u65e5\u5e38\u4f7f\u7528\u7684\u4e1c\u897f\u4e4b\u95f4\u7684\u80f6\u6c34\u3002<\/p>\n<p>\u6587\u4e2d\u4f8b\u5b50\u4f1a\u4f7f\u7528 Linux \u4e0b\u7684 C99\u00a0\u6765\u5199\uff08\u8bd1\u6ce8\uff1a1999 \u5e74\u7248\u7684 c \u8bed\u8a00\u6807\u51c6\uff09\uff0c\u4f46\u5f88\u591a\u4e3b\u9898\u90fd\u662f\u901a\u7528\u7684\u3002<em>\u6ce8\uff1a\u6211\u5bf9 Windows \u4e0d\u592a\u719f\u6089\uff0c\u4f46\u6211\u4f1a\u5f88\u9ad8\u5174\u9644\u4e0a\u80fd\u89e3\u91ca\u5b83\u7684\u6587\u7ae0\u94fe\u63a5\uff08\u5982\u679c\u6709\u7684\u8bdd\uff09\u3002\u6211\u4f1a\u5c3d\u91cf\u6807\u6ce8\u54ea\u4e9b\u65b9\u6cd5\u662f\u7279\u5b9a\u5e73\u53f0\u76f8\u5173\u7684\u3002\u4f46\u6211\u53ea\u662f\u4e2a\u51e1\u4eba\uff0c\u5982\u679c\u4f60\u53d1\u73b0\u6709\u51fa\u5165\uff0c\u8bf7\u544a\u8bc9\u6211\u3002<\/em><\/p>\n<h1>\u7406\u89e3\u865a\u62df\u5185\u5b58 &#8211; \u9519\u7efc\u590d\u6742<\/h1>\n<p> <\/p>\n<p>\u9664\u975e\u4f60\u5728\u5904\u7406\u67d0\u4e9b\u5d4c\u5165\u5f0f\u7cfb\u7edf\u6216\u5185\u6838\u7a7a\u95f4\u4ee3\u7801\uff0c\u5426\u5219\u4f60\u4f1a\u5728\u4fdd\u62a4\u6a21\u5f0f\u4e0b\u5de5\u4f5c\u3002\uff08\u8bd1\u6ce8\uff1a\u6307\u7684\u662f x86 CPU \u63d0\u51fa\u7684\u4fdd\u62a4\u6a21\u5f0f\uff0c\u901a\u8fc7\u786c\u4ef6\u63d0\u4f9b\u7684\u4e00\u7cfb\u5217\u673a\u5236\uff0c\u64cd\u4f5c\u7cfb\u7edf\u53ef\u4ee5\u7528\u4f4e\u6743\u9650\u8fd0\u884c\u7528\u6237\u4ee3\u7801\uff09\u3002\u8fd9<em>\u592a\u68d2\u4e86<\/em>\uff0c\u4f60\u7684\u7a0b\u5e8f\u53ef\u4ee5\u6709\u72ec\u7acb\u7684\u00a0<em>[\u865a\u62df]<\/em> \u5730\u5740\u7a7a\u95f4\u3002\u201c\u865a\u62df\u201d\u8fd9\u4e2a\u8bcd\u5728\u8fd9\u91cc\u5f88\u91cd\u8981\u3002\u8fd9\u8868\u793a\uff0c\u5305\u62ec\u5176\u4ed6\u4e00\u4e9b\u60c5\u51b5\uff0c\u4f60\u4e0d\u4f1a\u88ab\u53ef\u7528\u5185\u5b58\u9650\u5236\u4f4f\uff0c\u4f46\u4e5f\u6ca1\u6709\u8d44\u683c\u4f7f\u7528\u4efb\u4f55\u53ef\u7528\u5185\u5b58\u3002\u60f3\u7528\u8fd9\u4e2a\u7a7a\u95f4\uff0c\u4f60\u5f97\u627e OS \u8981\u4e00\u4e9b\u771f\u4e1c\u897f\u6765\u505a\u201c\u91cc\u5b50\u201d\uff0c\u8fd9\u53eb<em>\u6620\u5c04<\/em>\uff08 mapping \uff09\u3002\u8fd9\u4e2a\u91cc\u5b50\uff08 backing \uff09\u53ef\u4ee5\u662f\u7269\u7406\u5185\u5b58\uff08\u5e76\u4e0d\u4e00\u5b9a\u9700\u8981\u662f RAM \uff09\uff0c\u6216\u8005\u6301\u4e45\u5b58\u50a8\uff08\u8bd1\u6ce8\uff1a\u4e00\u822c\u6307\u786c\u76d8 \uff09\u3002\u524d\u8005\u88ab\u79f0\u4e3a*\u201c\u533f\u540d\u6620\u5c04\u201d*\u3002\u522b\u6025\uff0c\u9a6c\u4e0a\u8bb2\u91cd\u70b9\u3002<\/p>\n<p>\u865a\u62df\u5185\u5b58\u5206\u914d\u5668\uff08 VMA\uff0cvirtual memory allocator \uff09\u53ef\u80fd\u4f1a\u7ed9\u4f60\u4e00\u6bb5\u5e76\u4e0d\u7531\u4ed6\u6301\u6709\u7684\u5185\u5b58\uff0c\u5e76\u4e14\u5f92\u52b3\u5730\u5e0c\u671b\u4f60\u4e0d\u53bb\u7528\u5b83\u3002\u5c31\u50cf\u5982\u4eca\u7684\u94f6\u884c\u4e00\u6837\uff08\u8bd1\u6ce8\uff1a\u5e94\u8be5\u662f\u6307\u94f6\u884c\u5b58\u6b3e\uff09\u3002\u8fd9\u88ab\u79f0\u4e3a overcomiting[4]\uff08\u8bd1\u6ce8\uff1a\u6307\u5141\u8bb8\u7533\u8bf7\u8d85\u8fc7\u53ef\u7528\u7a7a\u95f4\u7684\u5185\u5b58\uff09\uff0c\u6709\u4e00\u4e9b\u6b63\u5f53\u7684\u5e94\u7528\u6709\u8fd9\u79cd\u9700\u6c42\uff08\u4f8b\u5982\u7a00\u758f\u6570\u7ec4\uff09\uff0c\u8fd9\u4e5f\u610f\u5473\u7740\u5185\u5b58\u5206\u914d\u4e0d\u4f1a\u7b80\u5355\u88ab\u62d2\u7edd\u3002<\/p>\n<pre><code>char\u00a0*block\u00a0=\u00a0malloc(1024\u00a0*\u00a0sizeof(char)); if\u00a0(block\u00a0==\u00a0NULL)\u00a0{     return\u00a0-ENOMEM;\u00a0\/*\u00a0sad\u00a0:(\u00a0*\/ } <\/code><\/pre>\n<p>\u68c0\u67e5 NULL \u8fd4\u56de\u503c\u662f\u4e2a\u597d\u4e60\u60ef\uff0c\u4f46\u5df2\u7ecf\u6ca1\u6709\u8fc7\u53bb\u90a3\u4e48\u5f3a\u5927\u4e86\u3002\u7531\u4e8e overcommmit \u673a\u5236\u7684\u5b58\u5728\uff0cOS \u53ef\u80fd\u4f1a\u7ed9\u4f60\u7684\u5185\u5b58\u5206\u914d\u5668\u4e00\u4e2a\u6709\u6548\u7684\u6307\u9488\uff0c\u4f46\u662f\u5f53\u4f60\u8981\u8bbf\u95ee\u5b83\u7684\u65f6\u5019 \u2014\u2014 \u94db*\u3002\u8fd9\u91cc\u7684\u201c<em>\u94db<\/em>\u201d\u662f\u5e73\u53f0\u76f8\u5173\u7684\uff0c\u4f46\u662f\u901a\u5e38\u8868\u73b0\u4e3a\u4f60\u7684\u8fdb\u7a0b\u88ab\u00a0OOM Killer\u00a0[5]\u5e72\u6389\u3002\uff08\u8bd1\u6ce8\uff1aOOM \u5373 Out Of Memory\uff0c\u5f53\u5185\u5b58\u4e0d\u8db3\u65f6\uff0cLinux \u4f1a\u6839\u636e\u4e00\u5b9a\u89c4\u5219\u6311\u51fa\u4e00\u4e2a\u8fdb\u7a0b\u6740\u6389\uff0c\u5e76\u5728 dmesg \u91cc\u7559\u4e0b\u8bb0\u5f55\uff09<\/p>\n<p><em>\u2014\u2014 \u8fd9\u91cc\u6709\u70b9\u8fc7\u5ea6\u7b80\u5316\u4e86\uff1b\u5728\u540e\u9762\u7684\u7ae0\u8282\u91cc\u6709\u8fdb\u4e00\u6b65\u7684\u89e3\u91ca\uff0c\u4f46\u6211\u503e\u5411\u4e8e\u5728\u94bb\u7814\u7ec6\u8282\u4e4b\u524d\u5148\u8fc7\u4e00\u904d\u8fd9\u4e9b\u66f4\u57fa\u7840\u7684\u4e1c\u897f\u3002<\/em><\/p>\n<h1>\u8fdb\u7a0b\u7684\u5185\u5b58\u5e03\u5c40<\/h1>\n<p> <\/p>\n<p>\u8fdb\u7a0b\u7684\u5185\u5b58\u5e03\u5c40\u5728 Gustavo Duarte \u7684\u300a Anatomy of a Program in Memory \u300b[6] \u91cc\u89e3\u91ca\u5f97\u5f88\u597d\u4e86\uff0c\u6240\u4ee5\u6211\u53ea\u5f15\u7528\u539f\u6587\uff0c\u5e0c\u671b\u8fd9\u7b97\u662f<em>\u5408\u7406\u4f7f\u7528<\/em>\u3002\u6211\u53ea\u6709\u4e00\u4e9b\u5c0f\u610f\u89c1\uff0c\u56e0\u4e3a\u8be5\u6587\u53ea\u4ecb\u7ecd\u4e86 x86-32 \u7684\u5185\u5b58\u5e03\u5c40\uff0c\u4e0d\u8fc7\u8fd8\u597d x86-64 \u53d8\u5316\u4e0d\u5927\uff0c\u9664\u4e86\u8fdb\u7a0b\u53ef\u4ee5\u7528\u5927\u5f97\u591a\u7684\u7a7a\u95f4 \u2014\u2014\u00a0\u5728 Linux \u4e0b\u9ad8\u8fbe 48 \u4f4d\u3002<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/05\/20200516_5ec05e4f42124.png\" alt=\"[\u8bd1] \uff23\u7a0b\u5e8f\u5458\u8be5\u77e5\u9053\u7684\u5185\u5b58\u77e5\u8bc6 (1)\" \/><\/p>\n<p>(\u6765\u6e90\uff1aLinux \u5730\u5740\u7a7a\u95f4\u5e03\u5c40 &#8211; by Gustavo Duarte)<\/p>\n<p>\u8bd1\u6ce8\uff1a\u9488\u5bf9\u4e0a\u56fe\u52a0\u4e00\u4e9b\u89e3\u91ca\u5907\u67e5<\/p>\n<ol>\n<li>\u56fe\u4e2d\u663e\u793a\u7684\u5730\u5740\u7a7a\u95f4\u662f\u7531\u9ad8\u5230\u4f4e\uff0c0x00000000 \u5728\u5e95\u90e8\uff0c\u6700\u9ad8 0xFFFFFFFF\uff0c\u4e00\u5171 4GB \uff08 2^32 \uff09\u3002<\/li>\n<li>\u9ad8\u4f4d\u7684 1GB \u662f\u5185\u6838\u7a7a\u95f4\uff0c\u7528\u6237\u4ee3\u7801 <strong>\u4e0d\u80fd<\/strong> \u8bfb\u5199\uff0c\u5426\u5219\u4f1a\u89e6\u53d1\u6bb5\u9519\u8bef\u3002\u56fe\u53f3\u4fa7\u6807\u6ce8\u7684\u00a00xC0000000 \u5373 3GB \uff1b TASK_SIZE \u662f Linux \u5185\u6838\u7f16\u8bd1\u914d\u7f6e\u7684\u540d\u79f0\uff0c\u8868\u793a\u5185\u6838\u7a7a\u95f4\u7684\u8d77\u59cb\u5730\u5740\u3002<\/li>\n<li>Random stack offset\uff1a\u52a0\u4e0a\u968f\u673a\u504f\u79fb\u91cf\u4ee5\u540e\u53ef\u4ee5\u5927\u5e45\u964d\u4f4e\u88ab\u6808\u6ea2\u51fa\u653b\u51fb\u7684\u98ce\u9669\u3002<\/li>\n<li>Stack \uff08 grows down \uff09: \u8fdb\u7a0b\u7684\u6808\u7a7a\u95f4\uff0c\u5411\u4e0b\u589e\u957f\uff0c\u6808\u5e95\u5728\u9ad8\u4f4d\u5730\u5740\uff0cPUSH \u6307\u4ee4\u4f1a\u51cf\u5c0f CPU \u7684 SP \u5bc4\u5b58\u5668\uff08 stack pointer \uff09\u3002\u56fe\u53f3\u4fa7\u7684 RLIMIT_STACK \u662f\u5185\u6838\u5bf9\u6808\u7a7a\u95f4\u5927\u5c0f\u7684\u9650\u5236\uff0c\u4e00\u822c\u662f 8MB\uff0c\u53ef\u4ee5\u7528 setrlimit \u7cfb\u7edf\u8c03\u7528\u4fee\u6539\u3002<\/li>\n<li>Memory Mapping Segment\uff1a\u5185\u5b58\u6620\u5c04\u533a\uff0c\u901a\u8fc7 mmap \u7cfb\u7edf\u8c03\u7528\uff0c\u5c06\u6587\u4ef6\u6620\u5c04\u5230\u8fdb\u7a0b\u7684\u5730\u5740\u7a7a\u95f4\uff08\u5305\u62ec libc.so \u8fd9\u6837\u7684\u52a8\u6001\u5e93\uff09\uff0c\u6216\u8005\u533f\u540d\u6620\u5c04\uff08\u4e0d\u9700\u8981\u6620\u5c04\u6587\u4ef6\uff0c\u8ba9 OS \u5206\u914d\u66f4\u591a\u6709\u91cc\u5b50\u7684\u5730\u5740\u7a7a\u95f4\uff09\u3002<\/li>\n<li>Heap\uff1a\u6211\u4eec\u5e38\u8bf4\u7684\u5806\u7a7a\u95f4\uff0c\u4ece\u4e0b\u5f80\u4e0a\u589e\u957f\uff0c\u901a\u8fc7 brk\/sbrk \u7cfb\u7edf\u8c03\u7528\u6269\u5c55\u5176\u4e0a\u9650<\/li>\n<li>BSS \u6bb5\uff1a\u5305\u542b\u672a\u521d\u59cb\u5316\u7684\u9759\u6001\u53d8\u91cf<\/li>\n<li>Data \u6bb5\uff1a\u4ee3\u7801\u91cc\u9759\u6001\u521d\u59cb\u5316\u7684\u53d8\u91cf<\/li>\n<li>Text \u6bb5\uff08 ELF \uff09\uff1a\u8fdb\u7a0b\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff08\u673a\u5668\u7801\uff09<\/li>\n<li>\u8fd9\u91cc\u8bf4\u7684\u6bb5\uff08 segment \uff09\u7684\u6982\u5ff5\uff0c\u6e90\u4e8e x86 cpu \u7684\u6bb5\u9875\u5f0f\u5185\u5b58\u7ba1\u7406<\/li>\n<\/ol>\n<p>\u56fe\u4e2d\u4e5f\u5c55\u793a\u4e86\u00a0\u5185\u5b58\u6620\u5c04\u6bb5\uff08 memory mapping segment, MMS \uff09\u662f\u5411\u4e0b\u589e\u957f\u7684\uff0c\u4f46\u5e76\u4e0d\u603b\u662f\u8fd9\u6837\u3002MMS \u901a\u5e38\uff08\u8be6\u89c1 Linux \u5185\u6838\u4ee3\u7801 x86\/mm\/mmap.c:113 \u548c arch\/mm\/mmap.c:1953 \uff09\u5f00\u59cb\u4e8e\u6808\u7684\u6700\u4f4e\u5730\u5740\uff08\u8bd1\u6ce8\uff1a\u5373\u6808\u5e95\uff09\u4ee5\u4e0b\u7684\u67d0\u4e2a\u968f\u673a\u5730\u5740\u3002\u6ce8\u610f\u662f\u201c\u901a\u5e38\u201d\uff0c\u56e0\u4e3a\u5b83\u4e5f\u53ef\u80fd\u5728\u6808\u7684\u4e0a\u65b9 \uff0c\u5982\u679c\u6808\u7a7a\u95f4\u9650\u5236\u5f88\u5927\uff08\u6216\u65e0\u9650\uff1b\u8bd1\u6ce8\uff1a\u53ef\u7528 setrlimit \u4fee\u6539\uff09\uff0c\u6216\u8005\u542f\u7528\u4e86\u517c\u5bb9\u5e03\u5c40\u3002\u8fd9\u4e00\u70b9\u6709\u591a\u91cd\u8981\uff1f\u2014\u2014\u4e0d\u91cd\u8981\uff0c\u4f46\u53ef\u4ee5\u8ba9\u4f60\u4e86\u89e3\u5230<em>\u81ea\u7531\u5730\u5740\u8303\u56f4<\/em>\uff08 free address ranges \uff09\u3002<\/p>\n<p>\u5728\u4e0a\u56fe\u4e2d\uff0c\u4f60\u53ef\u4ee5\u770b\u5230 3 \u4e2a\u4e0d\u540c\u7684\u53d8\u91cf\u5b58\u653e\u533a\uff1a\u8fdb\u7a0b\u7684\u6570\u636e\u6bb5\uff08\u9759\u6001\u5b58\u50a8\uff0c\u6216\u5806\u5185\u5b58\u5206\u914d\uff09\uff0c\u5185\u5b58\u6620\u5c04\u6bb5\uff0c\u548c\u6808\u3002\u6211\u4eec\u4ece\u8fd9\u91cc\u5f00\u59cb\u3002<\/p>\n<h1>\u7406\u89e3\u6808\u4e0a\u7684\u5185\u5b58\u5206\u914d<\/h1>\n<p> <\/p>\n<p>\u88c5\u5907\u7bb1\uff1a<\/p>\n<ul>\n<li>alloca() &#8211; \u5728\u8c03\u7528\u65b9\u7684\u6808\u5e27\u4e0a\u5206\u914d\u5185\u5b58<\/li>\n<li>getrlimit() &#8211; \u83b7\u53d6 \/\u8bbe\u7f6e\u00a0resource limits<\/li>\n<li>sigaltstack() &#8211; \u8bbe\u7f6e\u6216\u83b7\u53d6\u4fe1\u53f7\u6808\u4e0a\u4e0b\u6587<\/li>\n<\/ul>\n<p>\u6808\u76f8\u5bf9\u6bd4\u8f83\u5bb9\u6613\u7406\u89e3\uff0c\u6bd5\u7adf\u6bcf\u4e2a\u4eba\u90fd\u77e5\u9053\u5982\u4f55\u5728\u6808\u4e0a\u653e\u4e00\u4e2a\u53d8\u91cf\uff0c\u5bf9\u5427 \uff1f\u6bd4\u5982\uff1a<\/p>\n<pre><code>int\u00a0stairway\u00a0=\u00a02; int heaven[] = { 6, 5, 4 }; <\/code><\/pre>\n<p>\u53d8\u91cf\u7684\u6709\u6548\u6027\u53d7\u5230\u4f5c\u7528\u57df\u7684\u9650\u5236\u3002\u5728 C \u91cc\uff0c\u4f5c\u7528\u57df\u6307\u7684\u5c31\u662f\u4e00\u5bf9\u5927\u62ec\u53f7 <code>{}<\/code>\u3002\u56e0\u6b64\u6bcf\u6b21\u9047\u5230\u4e00\u4e2a\u53f3\u5927\u62ec\u53f7\uff0c\u5bf9\u5e94\u7684\u53d8\u91cf\u4f5c\u7528\u57df\u5c31\u7ed3\u675f\u4e86\u3002<\/p>\n<p>\u7136\u540e\u662f alloca()\uff0c\u5728\u5f53\u524d\u00a0<em>\u6808\u5e27<\/em>\u4e0a\u52a8\u6001\u5206\u914d\u5185\u5b58\u3002\u6808\u5e27\u548c\u5185\u5b58\u5e27\uff08\u4e5f\u53eb\u505a\u7269\u7406\u9875\uff09\u4e0d\u592a\u4e00\u6837\uff0c\u5b83\u53ea\u662f\u4e00\u7ec4\u88ab\u538b\u5230\u6808\u4e0a\u7684\u6570\u636e\uff08\u51fd\u6570\uff0c\u53c2\u6570\uff0c\u53d8\u91cf\u7b49\uff09\u3002\u7531\u4e8e\u6211\u4eec\u5728\u6808\u9876\uff08\u8bd1\u6ce8\uff1aSP \u5bc4\u5b58\u5668\u603b\u662f\u6307\u5411\u6808\u9876\uff09\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u5269\u4e0b\u7684\u6808\u7a7a\u95f4\uff0c\u53ea\u8981\u4e0d\u8d85\u8fc7\u6808\u5927\u5c0f\u9650\u5236\u3002<\/p>\n<p>\u8fd9\u5c31\u662f\u53d8\u957f\u6570\u7ec4\uff08 variable-length\uff0cVLA \uff09\u548c alloca \u7684\u539f\u7406\uff0c\u533a\u522b\u5728\u4e8e \uff0cVLA \u53d7\u9650\u4e8e\u4f5c\u7528\u57df\uff0calloca \u5206\u914d\u7684\u5185\u5b58\u7684\u6709\u6548\u6027\u53ef\u4ee5\u6301\u7eed\u5230\u5f53\u524d\u51fd\u6570\u8fd4\u56de\u3002\u8fd9\u91cc\u6ca1\u6709\u8bed\u8a00\u5f8b\u5e08\u4e1a\u52a1\uff08\u8bd1\u6ce8\uff1a\u6ca1\u4eba\u7ba1\u4f60\uff0c\u7231\u548b\u548b\u5730\uff09\uff0c\u4f46\u5982\u679c\u4f60\u5728\u5faa\u73af\u91cc\u7528 alloca \u53ef\u80fd\u4f1a\u8e29\u5751\uff0c\u56e0\u4e3a\u4f60\u6ca1\u529e\u6cd5\u91ca\u653e\u5b83\u5206\u914d\u7684\u7a7a\u95f4\uff1a<\/p>\n<pre><code>void laugh(void) {     for (unsigned i = 0; i &lt; megatron; ++i) {         char *res = alloca(2);         memcpy(res, \"ha\", 2);         char vla[2] = {'h','a'}     } \/* vla dies, res lives *\/ } \/* all allocas die *\/ <\/code><\/pre>\n<p>\u5982\u679c\u8981\u7533\u8bf7\u5927\u91cf\u5185\u5b58\uff0cVLA \u548c alloca \u90fd\u4e0d\u592a\u597d\u4f7f\uff0c\u56e0\u4e3a\u4f60\u51e0\u4e4e\u65e0\u6cd5\u63a7\u5236\u53ef\u7528\u7684\u6808\u7a7a\u95f4\uff0c\u5982\u679c\u5206\u914d\u5185\u5b58\u8d85\u8fc7\u6808\u9650\u5236\uff0c\u5c31\u4f1a\u9047\u5230\u4ee4\u4eba\u559c\u95fb\u4e50\u89c1\u7684 stack overflow \u3002\u6709\u4e24\u79cd\u529e\u6cd5\u53ef\u4ee5\u7ed5\u8fc7\u5b83\uff0c\u4f46\u90fd\u4e0d\u592a\u5b9e\u7528\uff1a<\/p>\n<p>\u7b2c\u4e00\u79cd\u662f\u7528\u00a0 <code>sigaltstack()<\/code>\u00a0\u6765\u6355\u83b7\u5e76\u5904\u7406 SIGSEGV \u4fe1\u53f7\uff0c\u4f46\u8fd9\u53ea\u80fd\u8ba9\u4f60\u6355\u83b7\u6808\u6ea2\u51fa\uff08\u8bd1\u6ce8\uff1a\u7a0b\u5e8f\u4ecd\u7136\u65e0\u6cd5\u83b7\u5f97\u6240\u9700\u7684\u5185\u5b58\uff09\u3002<\/p>\n<p>\u53e6\u4e00\u79cd\u662f\u7f16\u8bd1\u65f6\u6307\u5b9a\u201csplit-stacks\u201d\uff0c\u8fd9\u4f1a\u5c06\u4e00\u4e2a\u5927\u7684 stack \u5206\u5272\u6210\u7528\u94fe\u8868\u7ec4\u7ec7\u7684\u201c\u6808\u788e\u7247\u201d\uff08 stacklet \uff09\u3002\u5c31\u6211\u6240\u77e5\uff0cGCC \u548c clang \u7f16\u8bd1\u5668\u53ef\u4ee5\u7528\u00a0<code>-fsplit-stasck<\/code> \u9009\u9879\u6765\u542f\u7528\u8fd9\u4e2a\u7279\u6027\u3002\u7406\u8bba\u4e0a\u8fd9\u4f1a\u6539\u5584\u5185\u5b58\u6d88\u8017\uff0c\u5e76\u964d\u4f4e\u521b\u5efa\u7ebf\u7a0b\u7684\u5f00\u9500\uff0c\u56e0\u4e3a\u521a\u5f00\u59cb\u7684\u65f6\u5019\u6808\u53ef\u4ee5\u5f88\u5c0f\uff0c\u5e76\u6309\u9700\u6269\u5c55\u3002\u4f46\u5b9e\u9645\u4e0a\u53ef\u80fd\u4f1a\u9047\u5230\u517c\u5bb9\u95ee\u9898\uff0c\u56e0\u4e3a\u8fd9\u9700\u8981\u4e00\u4e2a\u652f\u6301 split-stack \u7684\u94fe\u63a5\u5668\uff08\u4f8b\u5982 gold \uff1b\u8bd1\u6ce8\uff1a\u8fd9\u662f GNU \u7684 ELF \u94fe\u63a5\u5668\uff0c\u4e0d\u540c\u4e8e\u6211\u4eec\u5e38\u7528\u7684\u94fe\u63a5\u5668 ld\uff0c\u9488\u5bf9 ELF \u94fe\u63a5\u6027\u80fd\u66f4\u597d\uff09\u3001\u800c\u8fd9\u662f\u5bf9\u5e93\u900f\u660e\u7684\uff0c\u8fd8\u53ef\u80fd\u6709\u6027\u80fd\u95ee\u9898\uff0c\u4f8b\u5982\u00a0Go \u7684\u00a0hot-split\u00a0\u95ee\u9898\uff0c\u5728\u00a0Agis Anastasopoulos\u00a0\u7684\u8fd9\u7bc7\u6587\u7ae0[7] \u4e2d\u6709\u8be6\u7ec6\u89e3\u91ca\u3002\uff08\u8bd1\u6ce8\uff1aGo 1.3 \u4e4b\u524d\u7528 split stack\uff0c\u5373\u524d\u8ff0\u7528\u94fe\u8868\u4e32\u8d77\u6765\u7684\u6808\uff0c\u5728\u67d0\u4e9b\u60c5\u51b5\u53ef\u80fd\u56e0\u53cd\u590d\u7684\u6808\u6269\u5c55\u548c\u6536\u7f29\u5e26\u6765\u6027\u80fd\u95ee\u9898\uff1b 1.3 \u5f00\u59cb\u6539\u6210\u4f7f\u7528\u8fde\u7eed\u7684\u6808\u7a7a\u95f4\uff0c\u7a7a\u95f4\u4e0d\u591f\u65f6\u91cd\u65b0\u5206\u914d\u3001\u62f7\u8d1d\u5185\u5bb9\u3001\u4fee\u6539\u6307\u5411\u6808\u7a7a\u95f4\u7684\u6307\u9488\uff0c\u56e0\u6b64\u4e5f\u8981\u6c42\u7f16\u8bd1\u5668\u80fd\u51c6\u786e\u5206\u6790\u6307\u9488\u9003\u9038\u7684\u60c5\u51b5\uff09<\/p>\n<p>\u4f11\u606f\u4e00\u4e0b\uff0c\u7b2c\u4e00\u7bc7\u5c31\u5230\u8fd9\u91cc\u3002<\/p>\n<p>\u4e0b\u4e00\u7bc7\u63a5\u7740\u7ffb\u8bd1\u4e0b\u4e00\u8282 Understanding \u00a0heap allocation\uff0c\u611f\u5174\u8da3\u7684\u8bb0\u5f97\u5173\u6ce8\uff0c\u7b49\u4e0d\u53ca\u7684\u63a8\u8350\u9605\u8bfb\u539f\u6587\u3002<\/p>\n<p>\u987a\u4fbf\u518d\u8d34\u4e0b\u4e4b\u524d\u63a8\u9001\u7684\u51e0\u7bc7\u6587\u7ae0\uff0c\u795d\u8fc7\u4e2a\u5145\u5b9e\u7684\u4e94\u4e00\u5047\u671f~<\/p>\n<ul>\n<li>\u300a\u8e29\u5751\u8bb0\uff1ago \u670d\u52a1\u5185\u5b58\u66b4\u6da8\u300b<\/li>\n<li>\u300aTCP\uff1a\u5b66\u5f97\u8d8a\u591a\u8d8a\u4e0d\u61c2\u300b<\/li>\n<li>\u300aUTF-8\uff1a\u4e00\u4e9b\u597d\u50cf\u6ca1\u4ec0\u4e48\u7528\u7684\u51b7\u77e5\u8bc6\u300b<\/li>\n<li>\u300a\u5173\u4e8e RSA \u7684\u4e00\u4e9b\u8da3\u4e8b\u300b<\/li>\n<li>\u300a\u7a0b\u5e8f\u5458\u9762\u8bd5\u6307\u5317\uff1a\u9762\u8bd5\u5b98\u89c6\u89d2\u300b<\/li>\n<\/ul>\n<h1>\u6b22\u8fce\u5173\u6ce8<\/h1>\n<p> <\/p>\n<p><img decoding=\"async\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2020\/05\/20200516_5ec05e531d465.png\" alt=\"[\u8bd1] \uff23\u7a0b\u5e8f\u5458\u8be5\u77e5\u9053\u7684\u5185\u5b58\u77e5\u8bc6 (1)\" \/><\/p>\n<pre><code>   \u2584\u2584\u2584\u2584\u2584\u2584\u2584   \u2584      \u2584\u2584\u2584\u2584 \u2584\u2584\u2584\u2584\u2584\u2584\u2584      \u2588 \u2584\u2584\u2584 \u2588 \u2584\u2580 \u2584 \u2580\u2588\u2588\u2584 \u2580\u2588\u2584 \u2588 \u2584\u2584\u2584 \u2588      \u2588 \u2588\u2588\u2588 \u2588  \u2588  \u2588  \u2588\u2580\u2580\u2580\u2588\u2580 \u2588 \u2588\u2588\u2588 \u2588      \u2588\u2584\u2584\u2584\u2584\u2584\u2588 \u2584 \u2588\u2580\u2588 \u2588\u2580\u2588 \u2584\u2580\u2588 \u2588\u2584\u2584\u2584\u2584\u2584\u2588      \u2584\u2584\u2584 \u2584\u2584\u2584\u2584\u2588  \u2580\u2584\u2588\u2580\u2580\u2580\u2588 \u2584\u2588\u2584\u2584   \u2584        \u2584\u2588\u2584\u2584\u2584\u2584\u2584\u2580\u2584\u2580\u2584\u2588\u2588   \u2580 \u2584  \u2588\u2580\u2584\u2584\u2580\u2584\u2584\u2588      \u2588 \u2588\u2580\u2584\u2580\u2584\u2584\u2580\u2580\u2588\u2584\u2580\u2588\u2584\u2580\u2588\u2588\u2588\u2588\u2588\u2580\u2588\u2580\u2580\u2588 \u2588\u2584       \u2580\u2580  \u2588\u2584\u2588\u2588\u2584\u2588\u2580  \u2588 \u2580\u2588\u2580 \u2580\u2588\u2580 \u2584\u2580\u2580\u2584\u2588      \u2588\u2580 \u2580 \u2584\u2584\u2584\u2584\u2584\u2584\u2580\u2584\u2588\u2588  \u2588 \u2584\u2588\u2588\u2588\u2588\u2580\u2580 \u2588\u2584      \u2584\u2580\u2584\u2584\u2584 \u2584 \u2580\u2580\u2584\u2588\u2588\u2588\u2588\u2580\u2588\u2580  \u2580 \u2588\u2584\u2584\u2584\u2580\u2584\u2588      \u2584\u2580\u2580\u2588\u2588\u2584\u2584  \u2588\u2580\u2584\u2580\u2588\u2580\u2580 \u2588\u2580 \u2584\u2584\u2584\u2588\u2588\u2580 \u2580       \u2584\u2584\u2584\u2584\u2584\u2584\u2584 \u2588 \u2588\u2580 \u2580\u2580   \u2584\u2588\u2588 \u2584 \u2588\u2584\u2580\u2588\u2588      \u2588 \u2584\u2584\u2584 \u2588 \u2588\u2584 \u2580\u2584\u2580 \u2580\u2588\u2588  \u2588\u2584\u2584\u2584\u2588\u2584  \u2580      \u2588 \u2588\u2588\u2588 \u2588 \u2584 \u2588\u2588\u2588\u2580\u2580\u2580\u2588\u2584 \u2588\u2580\u2584 \u2588\u2588\u2584 \u2580\u2588      \u2588\u2584\u2584\u2584\u2584\u2584\u2588 \u2588\u2588 \u2584\u2588\u2580\u2588  \u2588 \u2580\u2588\u2588\u2584\u2584\u2584  \u2588\u2584     <\/code><\/pre>\n<h1>\u53c2\u8003\u94fe\u63a5\uff1a<\/h1>\n<p> <\/p>\n<p>[1]\u00a0What a C programmer should know about memory https:\/\/marek.vavrusa.com\/memory\/<\/p>\n<p>[2]\u00a0What every programmer should know about memory http:\/\/www.akkadia.org\/drepper\/cpumemory.pdf<\/p>\n<p>[3]\u00a0stackoverflow.com &#8211;\u00a0What Every Programmer Should Know About Memory? https:\/\/stackoverflow.com\/questions\/8126311\/what-every-programmer-should-know-about-memory<\/p>\n<p>[4]\u00a0Kernel &#8211; overcommit accounting https:\/\/www.kernel.org\/doc\/Documentation\/vm\/overcommit-accounting<\/p>\n<p>[5] Linux\u00a0&#8211; Overcommit and OOM https:\/\/www.win.tue.nl\/~aeb\/linux\/lk\/lk-9.html#ss9.6<\/p>\n<p>[6]\u00a0anatomy\u00a0of\u00a0a program in\u00a0memory http:\/\/duartes.org\/gustavo\/blog\/post\/anatomy-of-a-program-in-memory\/<\/p>\n<p>[7]\u00a0Contiguous stacks in Go http:\/\/agis.io\/2014\/03\/25\/contiguous-stacks-in-go.html<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>21<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"1376380\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : teawithlife <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u901a\u4fd7\u6613\u61c2\uff0c\u624b\u52a8\u70b9\u8d5e                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376381\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : LU35 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u611f\u8c22\u5206\u4eab\uff0c\u5df2\u6536\u85cf                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376382\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cy476571989 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u611f\u8c22\u5206\u4eab\uff0c\u4e3b\u3002<\/p>\n<p>\u5bf9\u4e8e\u7ffb\u8bd1\uff0c\u4e0d\u77e5\u9053\u4f60\u5bf9\u4f60\u73b0\u5728\u7684\u7ffb\u8bd1\u65b9\u5f0f\u4f53\u9a8c\u5982\u4f55\uff0c\u6211\u81ea\u5df1\u505a\u4e86\u4e00\u4e2a\u7ffb\u8bd1\u5de5\u5177\uff0c\u4e13\u95e8\u7528\u4e8e\u7ffb\u8bd1\u5f00\u6e90\u9879\u76ee\u6587\u6863\uff0c\u5982\u679c\u4f60\u6709\u9700\u6c42\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u4e00\u4e0b\uff1awww_breword_com<\/p>\n<p>\u6211\u4f1a\u5148\u5c06\u6587\u6863\u8c03\u7528 Google translate \u7684\u673a\u5668\u7ffb\u8bd1\u63a5\u53e3\uff0c\u7136\u540e\u4f60\u76f4\u63a5\u5728\u673a\u7ffb\u7684\u57fa\u7840\u4e0a\u4fee\u6539\u5c31\u597d\u4e86\uff0c\u7ffb\u8bd1\u5b8c\u6210\u4e4b\u540e\uff0c\u4f60\u53ef\u4ee5\u4e0b\u8f7d\u8bd1\u6587\uff0c\u7136\u540e\u5c31\u53ef\u4ee5\u81ea\u5df1\u968f\u610f\u7684\u53d1\u5e03\u4e86\uff0c\u5e0c\u671b\u5bf9\u4f60\u6709\u7528\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376383\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : felix021 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @cy476571989 \u6211\u6bd4\u8f83\u559c\u6b22\u8fd9\u79cd\u9010\u5b57\u9010\u53e5\u7684\u7ffb\u8bd1\uff0c\u81ea\u5df1\u7422\u78e8\u7528\u8bcd\uff0c\u548c\u80cc\u540e\u7684\u6897                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376384\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xupefei <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u201c\u68c0\u67e5 NULL \u8fd4\u56de\u503c\u662f\u4e2a\u597d\u4e60\u60ef\uff0c\u4f46\u5df2\u7ecf\u6ca1\u6709\u8fc7\u53bb\u90a3\u4e48\u5f3a\u5927\u4e86\u3002\u201d<\/p>\n<p>\u8fd9\u7422\u78e8\u51fa\u6765\u7684\u7ffb\u8bd1\u8fd8\u662f\u4e0d\u592a\u884c\u3002\u6211\u731c\u201c\u5f3a\u5927\u201d\u7684\u539f\u6587\u662f critical \uff1f                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376385\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : felix021 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xupefei \u539f\u6587\u662f powerful\uff0c\u610f\u601d\u662f\u6709\u4e86 overcommit \u4ee5\u540e\uff0c\u5f88\u96be\u9047\u5230\u8fd4\u56de null \u7684\u60c5\u51b5\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376386\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : msg7086 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u987a\u4fbf\u4e00\u63d0\uff0cWindows \u4e0a\u6ca1\u6709 memory overcommit\uff0c\u6240\u4ee5 Windows \u4e0b\u8fd8\u662f\u80fd\u68c0\u6d4b\u5185\u5b58\u6307\u9488\u7684\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376387\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : felix021 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @msg7086 \u67e5\u4e86\u4e0b\uff0cstackoverflow \u4e0a\u8bf4\u201cWindows will allow a program to allocate more (virtual) memory than there is RAM on the machine, but ONLY if there is enough free disk space to be able to back the virtual memory requested by the program by disk if necessary.\u201d\uff0c\u4e5f\u5c31\u662f\u4ec5\u9650\u4e8e RAM + \u865a\u62df\u5185\u5b58                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376388\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : aneureka <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e3b\u6709\u70b9\u9ad8\u4ea7\u5440                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376389\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : felix021 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @aneureka \u52c9\u5f3a\u6309\u4e00\u5468\u4e00\u7bc7\u2026\u2026\u7ffb\u8bd1\u76f8\u5bf9\u597d\u70b9\uff0c\u76f8\u6bd4\u81ea\u5df1\u5199\uff0c\u4e0d\u90a3\u4e48\u8d39\u8111                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376390\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lsj8924 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6211\u89c9\u5f97\u5e94\u8be5\u662f\u6bcf\u4e2a\u7a0b\u5e8f\u5458\u8be5\u77e5\u9053\u7684\u7684\u64cd\u4f5c\u7cfb\u7edf\u77e5\u8bc6\u66f4\u6070\u5f53\u3002\u629b\u5f00\u64cd\u4f5c\u7cfb\u7edf\u53bb\u7406\u89e3\u5185\u5b58\u6709\u70b9\u626f\u3002\u865a\u62df\u5185\u5b58\u672c\u8eab\u5c31\u662f\u64cd\u4f5c\u7cfb\u7edf\u7684\u4e00\u4e2a\u5355\u5143\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376391\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : felix021 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @lsj8924 OS \u7684\u8bdd\u9898\u5c31\u6709\u70b9\u5927\u4e86\uff0c\u8fdb\u7a0b\u8c03\u5ea6\uff0c\u8bbe\u5907\u7ba1\u7406\u7b49\uff0c\u8fd9\u7bc7\u5173\u6ce8\u70b9\u8fd8\u662f\u5728\u5185\u5b58\u4e0a\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376392\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cabing <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8fd9\u4e2a\u5185\u5bb9\uff0c\u4e0d\u7528\u8fd9\u4e48\u770b\u5427\u3002\u3002\u3002\u592a\u7ec6\u8282\u4e86\u3002<\/p>\n<p>\u770b\u770b\u64cd\u4f5c\u7cfb\u7edf\uff0c\u865a\u62df\u5185\u5b58\u90a3\u4e00\u7ae0\uff0c\u5982\u679c\u60f3\u4e86\u89e3 linux\uff0c\u770b\u770b linux \u865a\u62df\u5185\u5b58\u90a3\u4e00\u7ae0\u3002<\/p>\n<p>\u63a8\u8350\u300a\u73b0\u4ee3\u64cd\u4f5c\u7cfb\u7edf\u300b                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376393\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : felix021 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @cabing \u5b9a\u4f4d\u4e0d\u540c\uff0c\u4e66\u672c\u901a\u5e38\u90fd\u5f88\u67af\u71e5\uff0c\u800c\u4e14\u9700\u8981\u5927\u91cf\u57fa\u7840\u6982\u5ff5\u7684\u94fa\u57ab\uff08\u9700\u8981\u5faa\u5e8f\u6e10\u8fdb\uff09                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376394\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xupefei <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @felix021 \u8fd9\u6837\u7684\u8bdd\uff0cpowerful \u5e94\u8be5\u7ffb\u8bd1\u6210 \u5fc5\u8981 \u6709\u7528 \u4e4b\u7c7b\u7684\u8bcd\u3002\u8fd9\u4e2a powerful \u53ef\u4ee5\u6362\u6210 important \u6216 essential \u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376395\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : felix021 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @xupefei \u786e\u5b9e\u201c\u6709\u7528\u201d\u8bfb\u8d77\u6765\u66f4\u901a\u987a\u4e00\u70b9                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376396\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : scnace <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6ca1\u6709\u5192\u72af\u7684\u610f\u601d\uff0c\u4f46\u662f\u6587\u7ae0\u4e2d\u51fa\u73b0\u4e86\u4e24\u6b21 overcommit\uff0c\u90fd\u62fc\u9519\u4e86 hhh \uff08\u4e0d\u8fc7\u7ed9\u7ffb\u8bd1\u70b9\u8d5e\uff0c\u6211\u4e5f\u503e\u5411\u4e8e\u6b63\u786e\u7684\u624b\u6cd5\u5e94\u8be5\u662f\u4e00\u4e9b\u672f\u8bed\u4e0d\u8981\u5f3a\u884c\u7ffb\u8bd1\uff0c\u800c\u662f\u5c3d\u91cf\u4fdd\u6301 native\uff0c\u7136\u540e\u52a0\u4e0a\u6ce8\u89e3                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376397\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : felix021 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @scnace \u55ef\uff0c\u6211\u4e5f\u53d1\u73b0\u4e86\uff0c\u6211\u7684 mbp \u7684 M \u952e\u6700\u8fd1\u4e0d\u7075\u5149\uff0c\u6253\u5b57\u633a\u75db\u82e6\u3002\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376398\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : korokke <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u611f\u8c22\uff0c\u5173\u6ce8\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376399\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : AllenHua <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u611f\u8c22\u4e3b\u5206\u4eab \u70b9\u8d5e                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"1376400\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : baoyexi <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u57fa\u7840\uff0c\u70b9\u8d5e                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>[\u8bd1] \uff23\u7a0b\u5e8f\u5458\u8be5\u77e5\u9053\u7684\u5185\u5b58\u77e5\u8bc6 &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/87280"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=87280"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/87280\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=87280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=87280"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=87280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}