Ubuntu 22.04 LTS \u7248\u672c\u5e26\u6765\u4e00\u9879\u65b0\u529f\u80fd\uff1a\u9ed8\u8ba4\u542f\u7528 systemd-oomd \u4f5c\u4e3a\u5185\u5b58\u4e0d\u8db3\u65f6\u7684\u5b88\u62a4\u8fdb\u7a0b\uff0c\u5b83\u53ef\u4ee5\u5728\u5185\u5b58\u9ad8\u538b\u7684\u60c5\u51b5\u4e0b\u5e72\u6389\u4e00\u90e8\u5206\u8fdb\u7a0b\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\u7136\u800c\uff0c\u8be5 OOMD \u529f\u80fd\u4f3c\u4e4e\u6740\u7ea2\u4e86\u773c\uff0c\u6709\u65f6\u5019\u5373\u4f7f\u7528\u6237\u6ca1\u6709\u611f\u5230\u4efb\u4f55\u5185\u5b58\u538b\u529b\uff0c\u5b83\u4e5f\u4f1a\u83ab\u540d\u5176\u5999\u5730\u7ec8\u6b62\u6b63\u5728\u8fd0\u884c\u7684\u7a0b\u5e8f\uff0c\u6bd4\u5982 Firefox\u3001Chrome \u6216 Visual Studio Code\uff0c\u4f53\u9a8c\u6781\u5dee\u7684\u7528\u6237\u5728 Ubuntu \u793e\u533a\u90ae\u4ef6\u5217\u8868\u4e2d\u5927\u91cf\u7559\u8a00\u5410\u69fd\u3002<\/p>\n
\u4e00\u4f4d\u6cae\u4e27\u7684\u7528\u6237\u5199\u9053\uff1a<\/p>\n
\r\n\u5728\u6740\u6b7b\u5e94\u7528\u7a0b\u5e8f\u4e4b\u524d\u5e94\u8be5\u6709\u4e00\u4e2a\u8b66\u544a\uff0c\u4ee5\u4fbf\u6709\u673a\u4f1a\u4fdd\u5b58\u5e94\u7528\u7a0b\u5e8f\u6570\u636e\u3002\u6740\u6b7b\u5e94\u7528\u7a0b\u5e8f\u540e\u81f3\u5c11\u5e94\u8be5\u6709\u9053\u6b49\u548c\u89e3\u91ca\u3002\u5f53\u524d\u7684\u884c\u4e3a\u7ed9\u4eba\u7684\u5370\u8c61\u662f Ubuntu 22.04 \u4f7f\u7528\u8d77\u6765\u4e0d\u53ef\u9760\u4e14\u4e0d\u5b89\u5168\uff0c\u8fd9\u5bf9\u4e8e LTS \u7248\u672c\u6765\u8bf4\u662f\u4e2a\u5927\u95ee\u9898\u3002\r\n<\/pre>\n<\/p>\n
\u968f\u540e\uff0cCanonical \u5de5\u7a0b\u5e08 Nick Rosbrook \u5728\u90ae\u4ef6\u4e2d\u89e3\u91ca\u4e86 OOMD \u6740\u6b7b\u8fdb\u7a0b\u7684\u6761\u4ef6\uff1a<\/p>\n
\u6761\u4ef6 1\uff1a\u5f53\u603b\u7cfb\u7edf\u7684\u5185\u5b58\u4f7f\u7528\u91cf\u548c\u4ea4\u6362\u4f7f\u7528\u91cf\u90fd\u8d85\u8fc7 SwapUsedLimit\uff08\u5728 Ubuntu \u4e0a\u9ed8\u8ba4\u4e3a 90%\uff09\uff0c cgoups \u4e2d\u8d85\u8fc7 5% \u7684\u4ea4\u6362\u5c31\u4f1a\u6210\u4e3a OOM \u7684\u7ec8\u7ed3\u5bf9\u8c61\u3002<\/p>\n
\u6761\u4ef6 2\uff1a\u5f53\u4e00\u4e2a\u5355\u5143\u7684 cgroup \u5185\u5b58\u538b\u529b\u8d85\u8fc7 MemoryPressureLimit \uff0c\u5219\u76d1\u63a7\u540e\u4ee3 cgroups \u5c06\u4ece\u5177\u6709\u6700\u591a\u56de\u6536\u7387\u7684\u8fdb\u7a0b\u5f00\u59cb\u6267\u884c\u7ec8\u6b62\u3002<\/p>\n
\u5728\u5b9e\u8df5\u4e2d\uff0c\u5927\u90e8\u5206\u5e94\u7528\u88ab\u6740\u6b7b\u90fd\u662f\u56e0\u4e3a\u6761\u4ef6 1\uff0c\u5f88\u5927\u7a0b\u5ea6\u4e0a\u662f\u56e0\u4e3a Ubuntu \u53ea\u63d0\u4f9b\u4e86 1GB \u7684\u4ea4\u6362\u7a7a\u95f4\uff0c SwapUsedLimit \u592a\u5bb9\u6613\u8fbe\u5230 90%\u3002<\/p>\n
\u57fa\u4e8e\u8fdb\u7a0b\u7684\u7ec8\u6b62\u6761\u4ef6\uff0cNick \u63d0\u51fa\u4e86\u4e00\u4e9b\u6539\u52a8\u7684\u601d\u8def\uff0c\u6bd4\u5982\u6539\u53d8 systemd-oomd \u8ba1\u7b97 \/ \u89e6\u53d1\u5185\u5b58\u503c\u7684\u65b9\u5f0f\uff0c\u53c8\u6216\u662f\u589e\u52a0 SwapUsedLimit \u7684\u503c\uff0c\u56e0\u4e3a 1 GB \u5b9e\u5728\u592a\u5c11\u4e86\u3002<\/p>\n
\u793e\u533a\u73b0\u5df2\u9488\u5bf9\u8be5\u95ee\u9898\u542f\u52a8\u4e86\u4e00\u4e2a Ubuntu \u5f00\u53d1\u7ebf\u7a0b\uff0c\u5f81\u6c42\u66f4\u5e7f\u6cdb\u7684 Ubuntu \u793e\u533a\u53cd\u9988\uff0c\u8be5\u95ee\u9898\u5e94\u8be5\u4f1a\u5728 22.04.1 \u66f4\u65b0\u4e2d\u5f97\u5230\u89e3\u51b3\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u7136\u800c\uff0c\u8be5 OOMD \u529f\u80fd\u4f3c\u4e4e\u6740\u7ea2\u4e86\u773c\uff0c\u6709\u65f6\u5019\u5373\u4f7f\u7528\u6237\u6ca1\u6709\u611f\u5230\u4efb\u4f55\u5185\u5b58\u538b\u529b\uff0c\u5b83\u4e5f\u4f1a\u83ab\u540d\u5176\u5999\u5730\u7ec8\u6b62\u6b63\u5728\u8fd0\u884c\u7684\u7a0b\u5e8f\uff0c […]<\/p>\n","protected":false},"author":1329,"featured_media":244901,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[21],"tags":[],"class_list":["post-244897","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/244897","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1329"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=244897"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/244897\/revisions"}],"predecessor-version":[{"id":244992,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/244897\/revisions\/244992"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/244901"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=244897"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=244897"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=244897"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}