{"id":338,"date":"2020-06-29T09:48:26","date_gmt":"2020-06-29T01:48:26","guid":{"rendered":"http:\/\/www.gbase8.cn\/?p=338"},"modified":"2020-09-09T19:03:38","modified_gmt":"2020-09-09T11:03:38","slug":"gbase-8a%e9%9b%86%e7%be%a4%e5%90%af%e5%8a%a8%e6%97%a5%e5%bf%97%e6%8a%a5%e9%94%99express-total-heap-size-exceeds-memory-limit","status":"publish","type":"post","link":"https:\/\/www.gbase8.cn\/en\/338","title":{"rendered":"\u5357\u5927\u901a\u7528GBase 8a\u96c6\u7fa4\u542f\u52a8\u65e5\u5fd7\u62a5\u9519express total heap size exceeds memory limit"},"content":{"rendered":"<p>\u539f\u56e0\u662fGBase 8a\u5728\u542f\u52a8\u65f6\u4f1a\u68c0\u67e5\u5f53\u524d\u5185\u5b58\u662f\u5426\u53ef\u4ee5\u6ee1\u8db3\u5185\u5b58\u5206\u914d\u8981\u6c42\uff0c\u5982\u679c\u4e0d\u6ee1\u8db3\u5219\u62a5\u8fd9\u4e2a\u9519\u8bef\u3002\u4e00\u822c\u5e38\u89c1\u4e8e\u5185\u5b58\u5f88\u5c0f\u7684\u573a\u666f\uff0c\u4ee5\u53ca\u5df2\u7ecf\u6709\u5176\u5b83\u5927\u91cf\u5360\u7528\u5185\u5b58\u7684\u7a0b\u5e8f\u5728\u8fd0\u884c\u7684\u60c5\u51b5\u3002\u89e3\u51b3\u65b9\u6848\u5305\u62ec\u6269\u5927\u5185\u5b58\u3001\u51cf\u5c11\u6570\u636e\u5e93\u5185\u5b58\u53c2\u6570\u4ee5\u53ca\u6740\u6389\u5176\u5b83\u5360\u7528\u5185\u5b58\u7684\u8fdb\u7a0b\u7b49\u3002<\/p>\n\n\n\n<p>\u9ed8\u8ba4\u5185\u5b58\u68c0\u6d4b\u516c\u5f0f<\/p>\n\n\n\n<p>gbase_heap_data + gbase_heap_temp + gbase_heap_large + gbase_buffer_insert &lt;= (\u7269\u7406\u5185\u5b58+swap\u7a7a\u95f4) * gbase_memory_pct_target<\/p>\n\n\n\n<p>\u5176\u4e2dgbase_memory_pct_target\u9ed8\u8ba4\u503c\u662f0.8\uff0c\u4e5f\u5c31\u662f80%<\/p>\n\n\n\n<p>\u800c\u5185\u5b58\u4e0d\u8db3\u7684\u53ef\u80fd\u6027<\/p>\n\n\n\n<p>1\u3001\u6709\u5176\u5b83\u8fdb\u7a0b\u5360\u7528\u4e86\u5185\u5b58\u3002 \u7279\u522b\u662f\u4e00\u4e9bjava\u7a0b\u5e8f\u3002<\/p>\n\n\n\n<p>2\u3001\u5185\u5b58\u68c0\u6d4b\u4f9d\u8d56\u64cd\u4f5c\u7cfb\u7edf\uff0c\u6709\u53ef\u80fd\u4e0d\u51c6<\/p>\n\n\n\n<p>Solution<\/p>\n\n\n\n<p>1\u3001\u6e05\u7406\u5176\u5b83\u5360\u7528\u5185\u5b58\u7684\u7a0b\u5e8f\uff0c\u4e0d\u8981\u90e8\u7f72\u5728\u6570\u636e\u5e93\u8282\u70b9\u4e0a\u3002<\/p>\n\n\n\n<p>2\u3001\u6216\u8005\u4eba\u5de5\u51cf\u5c11\u6570\u636e\u5e93\u7684\u542f\u52a8\u5185\u5b58\u53c2\u6570\uff0c<\/p>\n\n\n\n<p>gbase_heap_data<br>gbase_heap_temp <br>gbase_heap_large<\/p>\n\n\n\n<p>\u53c2\u8003<\/p>\n\n\n\n<figure class=\"wp-block-embed-wordpress wp-block-embed is-type-wp-embed is-provider-\u8001\u7d2b\u7af9\u7684\u5bb6\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"wp-embedded-content\" data-secret=\"nimFN8MP1X\"><a href=\"http:\/\/www.gbase8.cn\/en\/?p=202\">GBase 8a\u96c6\u7fa4\u5e38\u89c1\u5185\u5b58\u914d\u7f6e\u53c2\u6570<\/a><\/blockquote><iframe loading=\"lazy\" title=\"\u300aGBase 8a\u96c6\u7fa4\u5e38\u89c1\u5185\u5b58\u914d\u7f6e\u53c2\u6570\u300b\u2014\u8001\u7d2b\u7af9\u7684\u5bb6\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; clip: rect(1px, 1px, 1px, 1px);\" src=\"http:\/\/www.gbase8.cn\/?p=202&#038;embed=true#?secret=nimFN8MP1X\" data-secret=\"nimFN8MP1X\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>3\u3001\u8c03\u6574\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\u53c2\u6570\u3010\u672a\u7ecf\u5927\u89c4\u6a21\u9879\u76ee\u9a8c\u8bc1\uff0c\u4e0d\u5efa\u8bae\u4f7f\u7528\u3011<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">vm.overcommit_memory&nbsp;\u8bbe\u7f6e\u76f8\u5173\u3002\n\u53d6\u503c\u4e3a\uff1a\n 0 \u2013&nbsp;Heuristic overcommit handling\uff08\u7f3a\u7701\u503c\uff0c\u8bd5\u63a2\u5f0f\u7533\u8bf7\u3002\u5185\u6838\u5229\u7528\u67d0\u79cd\u7b97\u6cd5\u731c\u6d4b\u5185\u5b58\u7533\u8bf7\u662f\u5426\u5408\u7406\uff0c\u5b83\u8ba4\u4e3a\u4e0d\u5408\u7406\u5c31\u4f1a\u62d2\u7edd\uff09\n 1 \u2013 Always overcommit\n 2 \u2013 Don\u2019t overcommit\n<strong>\u4e3a\u4e86\u4fdd\u8bc1GBase\u7533\u8bf7\u5185\u5b58\u6210\u529f\uff0c\u53ef\u4ee5\u8bbe\u7f6evm.overcommit_memory=1<\/strong><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>\u53c2\u8003\u6587\u7ae0<\/p>\n\n\n\n<p><a href=\"https:\/\/blog.csdn.net\/longwang155069\/article\/details\/50897026\">https:\/\/blog.csdn.net\/longwang155069\/article\/details\/50897026<\/a><\/p>","protected":false},"excerpt":{"rendered":"<p>\u539f\u56e0\u662fGBase 8a\u5728\u542f\u52a8\u65f6\u4f1a\u68c0\u67e5\u5f53\u524d\u5185\u5b58\u662f\u5426\u53ef\u4ee5\u6ee1\u8db3\u5185\u5b58\u5206\u914d\u8981\u6c42\uff0c\u5982\u679c\u4e0d\u6ee1\u8db3\u5219\u62a5\u8fd9\u4e2a\u9519\u8bef\u3002\u4e00\u822c\u5e38\u89c1\u4e8e\u5185\u5b58\u5f88\u5c0f\u7684\u573a\u666f\uff0c\u4ee5\u53ca\u5df2\u7ecf\u6709\u5176\u5b83\u5927\u91cf\u5360\u7528\u5185\u5b58\u7684\u7a0b\u5e8f\u5728\u8fd0\u884c\u7684\u60c5\u51b5\u3002\u89e3\u51b3\u65b9\u6848\u5305\u62ec\u6269\u5927\u5185\u5b58\u3001\u51cf\u5c11\u6570\u636e\u5e93\u5185\u5b58\u53c2\u6570\u4ee5\u53ca\u6740\u6389\u5176\u5b83\u5360\u7528\u5185\u5b58\u7684\u8fdb\u7a0b\u7b49\u3002<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[54],"tags":[39],"class_list":["post-338","post","type-post","status-publish","format-standard","hentry","category-gbase8a","tag-39"],"_links":{"self":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/338","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/comments?post=338"}],"version-history":[{"count":5,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/338\/revisions"}],"predecessor-version":[{"id":1156,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/posts\/338\/revisions\/1156"}],"wp:attachment":[{"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/media?parent=338"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/categories?post=338"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gbase8.cn\/en\/wp-json\/wp\/v2\/tags?post=338"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}