{"id":63604,"date":"2025-04-29T10:16:53","date_gmt":"2025-04-29T02:16:53","guid":{"rendered":"https:\/\/fwq.ai\/blog\/63604\/"},"modified":"2025-04-29T10:16:53","modified_gmt":"2025-04-29T02:16:53","slug":"linux%e6%80%8e%e4%b9%88%e6%9f%a5%e7%9c%8b%e5%86%85%e5%ad%98%e5%a4%a7%e5%b0%8f-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/63604\/","title":{"rendered":"linux\u600e\u4e48\u67e5\u770b\u5185\u5b58\u5927\u5c0f"},"content":{"rendered":"<blockquote><p>\n  \u53ef\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b linux \u7cfb\u7edf\u4e2d\u7684\u5185\u5b58\u5927\u5c0f\uff1afreetopvmstatcat \/proc\/meminfo\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/03\/2024060310121885627.jpg\" class=\"aligncenter\" title=\"linux\u600e\u4e48\u67e5\u770b\u5185\u5b58\u5927\u5c0f\u63d2\u56fe\" alt=\"linux\u600e\u4e48\u67e5\u770b\u5185\u5b58\u5927\u5c0f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u67e5\u770b Linux \u7cfb\u7edf\u4e2d\u7684\u5185\u5b58\u5927\u5c0f<\/strong><\/p>\n<p><strong>1. \u4f7f\u7528 free \u547d\u4ee4<\/strong><\/p>\n<p>free \u547d\u4ee4\u662f\u67e5\u770b\u7cfb\u7edf\u5185\u5b58\u72b6\u6001\u6700\u5e38\u7528\u7684\u547d\u4ee4\u3002\u5b83\u663e\u793a\u4e86\u603b\u5185\u5b58\u3001\u5df2\u7528\u5185\u5b58\u3001\u7a7a\u95f2\u5185\u5b58\u3001\u5171\u4eab\u5185\u5b58\u3001\u7f13\u51b2\u533a\u548c\u7f13\u5b58\u3002<\/p>\n<pre>free<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>2. \u4f7f\u7528 top \u547d\u4ee4<\/strong><\/p>\n<p>top \u547d\u4ee4\u53ef\u4ee5\u663e\u793a\u7cfb\u7edf\u5b9e\u65f6\u72b6\u6001\uff0c\u5305\u62ec\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3002\u6309 F2 \u952e\uff0c\u7136\u540e\u9009\u62e9 &#8220;Mem&#8221; \u5217\uff0c\u53ef\u4ee5\u67e5\u770b\u5185\u5b58\u5927\u5c0f\u548c\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n<pre>top<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>3. \u4f7f\u7528 vmstat \u547d\u4ee4<\/strong><\/p>\n<p>vmstat \u547d\u4ee4\u53ef\u4ee5\u663e\u793a\u865a\u62df\u5185\u5b58\u7edf\u8ba1\u4fe1\u606f\uff0c\u5305\u62ec\u5185\u5b58\u5927\u5c0f\u3002\u4f7f\u7528 -s \u9009\u9879\u53ef\u4ee5\u53ea\u663e\u793a\u6458\u8981\u4fe1\u606f\uff0c\u5176\u4e2d\u5305\u62ec\u603b\u5185\u5b58\u548c\u7a7a\u95f2\u5185\u5b58\u3002<\/p>\n<pre>vmstat -s<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>4. \u4f7f\u7528 cat \u547d\u4ee4<\/strong><\/p>\n<p>\u53ef\u4ee5\u4ece \/proc\/meminfo \u6587\u4ef6\u4e2d\u83b7\u53d6\u6709\u5173\u5185\u5b58\u7684\u66f4\u8be6\u7ec6\u7684\u4fe1\u606f\u3002\u4f7f\u7528 cat \u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u6587\u4ef6\u5185\u5bb9\u3002<\/p>\n<pre>cat \/proc\/meminfo<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u8be5\u6587\u4ef6\u5305\u542b\u8bb8\u591a\u4e0e\u5185\u5b58\u76f8\u5173\u7684\u7edf\u8ba1\u4fe1\u606f\uff0c\u5305\u62ec\uff1a<\/p>\n<ul>\n<li>MemTotal\uff1a\u603b\u5185\u5b58<\/li>\n<li>MemFree\uff1a\u7a7a\u95f2\u5185\u5b58<\/li>\n<li>MemAvailable\uff1a\u53ef\u7528\u7684\u5185\u5b58\uff0c\u5305\u62ec\u7f13\u51b2\u533a\u548c\u7f13\u5b58<\/li>\n<li>SwapTotal\uff1a\u4ea4\u6362\u5206\u533a\u603b\u5927\u5c0f<\/li>\n<li>SwapFree\uff1a\u7a7a\u95f2\u4ea4\u6362\u7a7a\u95f4\u5927\u5c0f<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u67e5\u770b\u5185\u5b58\u5927\u5c0f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8FDCServers\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53ef\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b linux \u7cfb\u7edf\u4e2d\u7684\u5185\u5b58\u5927\u5c0f\uff1afreetopvmstatcat \/proc\/meminfo \u5982\u4f55\u67e5\u770b Linux \u7cfb\u7edf\u4e2d\u7684\u5185\u5b58\u5927\u5c0f 1. \u4f7f\u7528 free \u547d\u4ee4 free \u547d\u4ee4\u662f\u67e5\u770b\u7cfb\u7edf\u5185\u5b58\u72b6\u6001\u6700\u5e38\u7528\u7684\u547d\u4ee4\u3002\u5b83\u663e\u793a\u4e86\u603b\u5185\u5b58\u3001\u5df2\u7528\u5185\u5b58\u3001\u7a7a\u95f2\u5185\u5b58\u3001\u5171\u4eab\u5185\u5b58\u3001\u7f13\u51b2\u533a\u548c\u7f13\u5b58\u3002 free \u767b\u5f55\u540e\u590d\u5236 2. \u4f7f\u7528 top \u547d\u4ee4 top \u547d\u4ee4\u53ef\u4ee5\u663e\u793a\u7cfb\u7edf\u5b9e\u65f6\u72b6\u6001\uff0c\u5305\u62ec\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3002\u6309 F2 \u952e\uff0c\u7136\u540e\u9009\u62e9 &#8220;Mem&#8221; \u5217\uff0c\u53ef\u4ee5\u67e5\u770b\u5185\u5b58\u5927\u5c0f\u548c\u4f7f\u7528\u60c5\u51b5\u3002 top \u767b\u5f55\u540e\u590d\u5236 3. \u4f7f\u7528 vmstat \u547d\u4ee4 vmstat \u547d\u4ee4\u53ef\u4ee5\u663e\u793a\u865a\u62df\u5185\u5b58\u7edf\u8ba1\u4fe1\u606f\uff0c\u5305\u62ec\u5185\u5b58\u5927\u5c0f\u3002\u4f7f\u7528 -s \u9009\u9879\u53ef\u4ee5\u53ea\u663e\u793a\u6458\u8981\u4fe1\u606f\uff0c\u5176\u4e2d\u5305\u62ec\u603b\u5185\u5b58\u548c\u7a7a\u95f2\u5185\u5b58\u3002 vmstat -s \u767b\u5f55\u540e\u590d\u5236 4. \u4f7f\u7528 cat \u547d\u4ee4 \u53ef\u4ee5\u4ece \/proc\/meminfo \u6587\u4ef6\u4e2d\u83b7\u53d6\u6709\u5173\u5185\u5b58\u7684\u66f4\u8be6\u7ec6\u7684\u4fe1\u606f\u3002\u4f7f\u7528 cat \u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u6587\u4ef6\u5185\u5bb9\u3002 cat \/proc\/meminfo \u767b\u5f55\u540e\u590d\u5236 \u8be5\u6587\u4ef6\u5305\u542b\u8bb8\u591a\u4e0e\u5185\u5b58\u76f8\u5173\u7684\u7edf\u8ba1\u4fe1\u606f\uff0c\u5305\u62ec\uff1a MemTotal\uff1a\u603b\u5185\u5b58 MemFree\uff1a\u7a7a\u95f2\u5185\u5b58 MemAvailable\uff1a\u53ef\u7528\u7684\u5185\u5b58\uff0c\u5305\u62ec\u7f13\u51b2\u533a\u548c\u7f13\u5b58 SwapTotal\uff1a\u4ea4\u6362\u5206\u533a\u603b\u5927\u5c0f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-63604","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/63604","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=63604"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/63604\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=63604"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=63604"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=63604"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}