{"id":55777,"date":"2024-11-20T14:42:10","date_gmt":"2024-11-20T06:42:10","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=55777"},"modified":"2024-11-20T14:42:10","modified_gmt":"2024-11-20T06:42:10","slug":"free-linux","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/free-linux.html","title":{"rendered":"Linux \u4e2dfree\u547d\u4ee4\u68c0\u67e5\u5185\u5b58\u4f7f\u7528\u60c5\u51b5"},"content":{"rendered":"
\u6211\u4eec\u90fd\u77e5\u9053\uff0c IT \u57fa\u7840\u8bbe\u65bd\u65b9\u9762\u7684\u5927\u591a\u6570\u670d\u52a1\u5668\uff08\u5305\u62ec\u4e16\u754c\u9876\u7ea7\u7684\u8d85\u7ea7\u8ba1\u7b97\u673a\uff09\u90fd\u8fd0\u884c\u5728 Linux \u5e73\u53f0\u4e0a\uff0c\u56e0\u4e3a\u548c\u5176\u4ed6\u64cd\u4f5c\u7cfb\u7edf\u76f8\u6bd4\uff0c Linux \u66f4\u52a0\u7075\u6d3b\u3002\u6709\u7684\u64cd\u4f5c\u7cfb\u7edf\u5bf9\u4e8e\u4e00\u4e9b\u5fae\u4e4e\u5176\u5fae\u7684\u6539\u52a8\u548c\u8865\u4e01\u66f4\u65b0\u90fd\u9700\u8981\u91cd\u542f\uff0c\u4f46\u662f Linux \u4e0d\u9700\u8981\uff0c\u53ea\u6709\u5bf9\u4e8e\u4e00\u4e9b\u5173\u952e\u8865\u4e01\u7684\u66f4\u65b0\uff0c Linux \u624d\u4f1a\u9700\u8981\u91cd\u542f\u3002<\/p>\n
<\/p>\n
Linux \u7cfb\u7edf\u7ba1\u7406\u5458\u9762\u4e34\u7684\u4e00\u5927\u6311\u6218\u662f\u5982\u4f55\u5728\u6ca1\u6709\u4efb\u4f55\u505c\u673a\u65f6\u95f4\u7684\u60c5\u51b5\u4e0b\u7ef4\u62a4\u7cfb\u7edf\u7684\u826f\u597d\u8fd0\u884c\u3002\u7ba1\u7406\u5185\u5b58\u4f7f\u7528\u662f Linux \u7ba1\u7406\u5458\u53c8\u4e00\u4e2a\u5177\u6709\u6311\u6218\u6027\u7684\u4efb\u52a1\u3002free\u662f Linux \u4e2d\u4e00\u4e2a\u6807\u51c6\u7684\u5e76\u4e14\u88ab\u5e7f\u6cdb\u4f7f\u7528\u7684\u547d\u4ee4\uff0c\u5b83\u88ab\u7528\u6765\u5206\u6790\u5185\u5b58\u7edf\u8ba1\uff08\u7a7a\u95f2\u548c\u5df2\u7528\uff09\u3002\u4eca\u5929\uff0c\u6211\u4eec\u5c06\u8981\u8ba8\u8bba free \u547d\u4ee4\u4ee5\u53ca\u5b83\u7684\u4e00\u4e9b\u6709\u7528\u9009\u9879\u3002<\/p>\n
free \u547d\u4ee4\u80fd\u591f\u663e\u793a\u7cfb\u7edf\u4e2d\u7269\u7406\u4e0a\u7684\u7a7a\u95f2\uff08free\uff09\u548c\u5df2\u7528\uff08used\uff09\u5185\u5b58\uff0c\u8fd8\u6709\u4ea4\u6362\uff08swap\uff09\u5185\u5b58\uff0c\u540c\u65f6\uff0c\u4e5f\u80fd\u663e\u793a\u88ab\u5185\u6838\u4f7f\u7528\u7684\u7f13\u51b2\uff08buffers\uff09\u548c\u7f13\u5b58\uff08caches\uff09\u3002\u8fd9\u4e9b\u4fe1\u606f\u662f\u901a\u8fc7\u89e3\u6790\u6587\u4ef6 \/proc\/meninfo \u800c\u6536\u96c6\u5230\u7684\u3002<\/p>\n
\u4e0d\u5e26\u4efb\u4f55\u9009\u9879\u8fd0\u884c free \u547d\u4ee4\u4f1a\u663e\u793a\u7cfb\u7edf\u5185\u5b58\uff0c\u5305\u62ec\u7a7a\u95f2\uff08free\uff09\u3001\u5df2\u7528\uff08used\uff09\u3001\u4ea4\u6362\uff08swap\uff09\u3001\u7f13\u51b2\uff08buffers\uff09\u3001\u7f13\u5b58\uff08cached\uff09\u548c\u4ea4\u6362\uff08swap\uff09\u7684\u5185\u5b58\u603b\u6570\u3002<\/p>\n
# free\r\n total used free shared buffers cached\r\nMem: 32869744 25434276 7435468 0 412032 23361716\r\n-\/+ buffers\/cache: 1660528 31209216\r\nSwap: 4095992 0 4095992\r\n<\/pre>\n\u8f93\u51fa\u6709\u4e09\u884c\uff1a<\/p>\n
\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c free \u547d\u4ee4\u4ee5 KB - Kilobytes \u4e3a\u5355\u4f4d\u8f93\u51fa\u7cfb\u7edf\u5185\u5b58\uff0c\u8fd9\u5bf9\u4e8e\u7edd\u5927\u591a\u6570\u7ba1\u7406\u5458\u6765\u8bf4\u4f1a\u6709\u4e00\u70b9\u8ff7\u7cca\uff08\u5f53\u7cfb\u7edf\u5185\u5b58\u5f88\u5927\u7684\u65f6\u5019\uff0c\u6211\u4eec\u4e2d\u7684\u8bb8\u591a\u4eba\u9700\u8981\u628a\u8f93\u51fa\u8f6c\u5316\u4e3a\u4ee5 MB \u4e3a\u5355\u4f4d\uff0c\u4ece\u800c\u624d\u80fd\u591f\u7406\u89e3\u5185\u5b58\u5927\u5c0f\uff09\u3002\u4e3a\u4e86\u907f\u514d\u8fd9\u4e2a\u8ff7\u60d1\uff0c\u6211\u4eec\u5728 free \u547d\u4ee4\u540e\u9762\u52a0\u4e0a -m \u9009\u9879\uff0c\u5c31\u53ef\u4ee5\u7acb\u5373\u5f97\u5230\u4ee5 MB - Megabytes\u4e3a\u5355\u4f4d\u7684\u8f93\u51fa\u3002<\/p>\n
# free -m\r\n total used free shared buffers cached\r\nMem: 32099 24838 7261 0 402 22814\r\n-\/+ buffers\/cache: 1621 30477\r\nSwap: 3999 0 3999\r\n<\/pre>\n\u5982\u4f55\u4ece\u4e0a\u9762\u7684\u8f93\u51fa\u4e2d\u68c0\u67e5\u5269\u4f59\u591a\u5c11\u7a7a\u95f2\u5185\u5b58\uff1f\u4e3b\u8981\u57fa\u4e8e\u5df2\u7528\uff08used\uff09\u548c\u7a7a\u95f2\uff08free\uff09\u4e24\u5217\u3002\u4f60\u53ef\u80fd\u5728\u60f3\uff0c\u4f60\u53ea\u6709\u5f88\u4f4e\u7684\u7a7a\u95f2\u5185\u5b58\uff0c\u56e0\u4e3a\u5b83\u53ea\u6709 10%\uff0c \u4e3a\u4ec0\u4e48\uff1f<\/p>\n
\u5982\u679c\u4f60\u7684 Linux \u7248\u672c\u662f\u6700\u65b0\u7684\uff0c\u90a3\u4e48\u6709\u4e00\u4e2a\u67e5\u770b\u5b9e\u9645\u7a7a\u95f2\u5185\u5b58\u7684\u9009\u9879\uff0c\u53eb\u505a\u53ef\u7528\uff08available\uff09 \uff0c\u5bf9\u4e8e\u65e7\u7684\u7248\u672c\uff0c\u8bf7\u770b\u663e\u793a -\/+ buffers\/cache \u90a3\u4e00\u884c\u5bf9\u5e94\u7684\u7a7a\u95f2\uff08free\uff09\u4e00\u5217\u3002<\/p>\n
\u5982\u4f55\u4ece\u4e0a\u9762\u7684\u8f93\u51fa\u4e2d\u68c0\u67e5\u6709\u591a\u5c11\u5b9e\u9645\u5df2\u7528\u5185\u5b58\uff1f\u57fa\u4e8e\u5df2\u7528\uff08used\uff09\u548c\u7a7a\u95f2\uff08free\uff09\u4e00\u5217\u3002\u4f60\u53ef\u80fd\u60f3\uff0c\u4f60\u5df2\u7ecf\u4f7f\u7528\u4e86\u8d85\u8fc7 95% \u7684\u5185\u5b58\u3002<\/p>\n
\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c free \u547d\u4ee4\u4f1a\u4ee5 KB - kilobytes \u4e3a\u5355\u4f4d\u663e\u793a\u8f93\u51fa\uff0c\u8fd9\u5bf9\u4e8e\u5927\u591a\u6570\u7ba1\u7406\u5458\u6765\u8bf4\u4f1a\u6709\u4e00\u4e9b\u8ff7\u60d1\uff0c\u6240\u4ee5\u6211\u4eec\u4f7f\u7528\u4e0a\u9762\u7684\u9009\u9879\u6765\u83b7\u5f97\u4ee5 MB - Megabytes \u4e3a\u5355\u4f4d\u7684\u8f93\u51fa\u3002\u4f46\u662f\uff0c\u5f53\u670d\u52a1\u5668\u7684\u5185\u5b58\u5f88\u5927\uff08\u8d85\u8fc7 100 GB \u6216 200 GB\uff09\u65f6\uff0c\u4e0a\u9762\u7684\u9009\u9879\u4e5f\u4f1a\u8ba9\u4eba\u5f88\u8ff7\u60d1\u3002\u6240\u4ee5\uff0c\u5728\u8fd9\u4e2a\u65f6\u5019\uff0c\u6211\u4eec\u53ef\u4ee5\u5728 free \u547d\u4ee4\u540e\u9762\u52a0\u4e0a -g \u9009\u9879\uff0c\u4ece\u800c\u7acb\u5373\u5f97\u5230\u4ee5 GB - Gigabytes \u4e3a\u5355\u4f4d\u7684\u8f93\u51fa\u3002<\/p>\n
# free -g\r\n total used free shared buffers cached\r\nMem: 31 24 7 0 0 22\r\n-\/+ buffers\/cache: 1 29\r\nSwap: 3 0 3\r\n<\/pre>\n\u663e\u793a\u5168\u90e8\u5185\u5b58\u884c<\/div>\n\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c free \u547d\u4ee4\u7684\u8f93\u51fa\u53ea\u6709\u4e09\u884c\uff08\u5185\u5b58\u3001\u7f13\u51b2\/\u7f13\u5b58\u4ee5\u53ca\u4ea4\u6362\uff09\u3002\u4e3a\u4e86\u7edf\u4e00\u4ee5\u5355\u72ec\u4e00\u884c\u663e\u793a\uff08\u5168\u90e8\uff08\u5185\u5b58\uff0b\u4ea4\u6362\uff09\u3001\u5df2\u7528\uff08\u5185\u5b58\uff0b\uff08\u5df2\u7528\uff0d\u7f13\u51b2\/\u7f13\u5b58\uff09\uff0b\u4ea4\u6362\uff09\u4ee5\u53ca\u7a7a\u95f2\uff08\u5185\u5b58\uff0b\uff08\u5df2\u7528\uff0d\u7f13\u51b2\/\u7f13\u5b58\uff09\uff0b\u4ea4\u6362\uff09\uff0c\u5728 \u2018free\u2019 \u547d\u4ee4\u540e\u9762\u52a0\u4e0a -t \u9009\u9879\u3002<\/p>\n
# free -t\r\n total used free shared buffers cached\r\nMem: 32869744 25434276 7435468 0 412032 23361716\r\n-\/+ buffers\/cache: 1660528 31209216\r\nSwap: 4095992 0 4095992\r\nTotal: 36965736 27094804 42740676\r\n<\/pre>\n\u6309\u5ef6\u8fdf\u8fd0\u884c free \u547d\u4ee4\u4ee5\u4fbf\u66f4\u597d\u7684\u7edf\u8ba1<\/div>\n\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c free \u547d\u4ee4\u53ea\u4f1a\u663e\u793a\u4e00\u6b21\u7edf\u8ba1\u8f93\u51fa\uff0c\u8fd9\u662f\u4e0d\u8db3\u591f\u8fdb\u4e00\u6b65\u6392\u9664\u6545\u969c\u7684\uff0c\u6240\u4ee5\uff0c\u53ef\u4ee5\u901a\u8fc7\u6dfb\u52a0\u5ef6\u8fdf\uff08\u5ef6\u8fdf\u662f\u6307\u5728\u51e0\u79d2\u540e\u518d\u6b21\u66f4\u65b0\uff09\u6765\u5b9a\u671f\u7edf\u8ba1\u5185\u5b58\u6d3b\u52a8\u3002\u5982\u679c\u4f60\u60f3\u4ee5\u4e24\u79d2\u7684\u5ef6\u8fdf\u8fd0\u884c free \u547d\u4ee4\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\uff08\u5982\u679c\u4f60\u60f3\u8981\u66f4\u591a\u7684\u5ef6\u8fdf\uff0c\u4f60\u53ef\u4ee5\u6309\u7167\u4f60\u7684\u610f\u613f\u66f4\u6539\u6570\u503c\uff09\u3002<\/p>\n
\u4e0b\u9762\u7684\u547d\u4ee4\u5c06\u4f1a\u6bcf 2 \u79d2\u8fd0\u884c\u4e00\u6b21\u76f4\u5230\u4f60\u9000\u51fa\uff1a<\/p>\n
# free -s 2\r\n total used free shared buffers cached\r\nMem: 32849392 25935844 6913548 188 182424 24632796\r\n-\/+ buffers\/cache: 1120624 31728768\r\nSwap: 20970492 0 20970492\r\n\r\n total used free shared buffers cached\r\nMem: 32849392 25935288 6914104 188 182424 24632796\r\n-\/+ buffers\/cache: 1120068 31729324\r\nSwap: 20970492 0 20970492\r\n\r\n total used free shared buffers cached\r\nMem: 32849392 25934968 6914424 188 182424 24632796\r\n-\/+ buffers\/cache: 1119748 31729644\r\nSwap: 20970492 0 20970492\r\n<\/pre>\n\u6309\u5ef6\u8fdf\u548c\u5177\u4f53\u6b21\u6570\u8fd0\u884c free \u547d\u4ee4<\/div>\n\u53e6\u5916\uff0c\u4f60\u53ef\u4ee5\u6309\u5ef6\u8fdf\u548c\u5177\u4f53\u6b21\u6570\u8fd0\u884c free \u547d\u4ee4\uff0c\u4e00\u65e6\u8fbe\u5230\u67d0\u4e2a\u6b21\u6570\uff0c\u4fbf\u81ea\u52a8\u9000\u51fa\u3002<\/p>\n
\u4e0b\u9762\u7684\u547d\u4ee4\u5c06\u4f1a\u6bcf 2 \u79d2\u8fd0\u884c\u4e00\u6b21 free \u547d\u4ee4\uff0c\u8ba1\u6570 5 \u6b21\u4ee5\u540e\u81ea\u52a8\u9000\u51fa\u3002<\/p>\n
# free -s 2 -c 5\r\n total used free shared buffers cached\r\nMem: 32849392 25931052 6918340 188 182424 24632796\r\n-\/+ buffers\/cache: 1115832 31733560\r\nSwap: 20970492 0 20970492\r\n\r\n total used free shared buffers cached\r\nMem: 32849392 25931192 6918200 188 182424 24632796\r\n-\/+ buffers\/cache: 1115972 31733420\r\nSwap: 20970492 0 20970492\r\n\r\n total used free shared buffers cached\r\nMem: 32849392 25931348 6918044 188 182424 24632796\r\n-\/+ buffers\/cache: 1116128 31733264\r\nSwap: 20970492 0 20970492\r\n\r\n total used free shared buffers cached\r\nMem: 32849392 25931316 6918076 188 182424 24632796\r\n-\/+ buffers\/cache: 1116096 31733296\r\nSwap: 20970492 0 20970492\r\n\r\n total used free shared buffers cached\r\nMem: 32849392 25931308 6918084 188 182424 24632796\r\n-\/+ buffers\/cache: 1116088 31733304\r\nSwap: 20970492 0 20970492\r\n<\/pre>\n\u53d6\u6d88\u7f13\u51b2\u533a\u548c\u7f13\u5b58\u5185\u5b58\u8f93\u51fa<\/div>\n\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u7f13\u51b2\/\u7f13\u5b58\u5185\u5b58\u662f\u540c\u65f6\u8f93\u51fa\u7684\u3002\u4e3a\u4e86\u53d6\u6d88\u7f13\u51b2\u548c\u7f13\u5b58\u5185\u5b58\u7684\u8f93\u51fa\uff0c\u53ef\u4ee5\u5728 free \u547d\u4ee4\u540e\u9762\u52a0\u4e0a -w \u9009\u9879\u3002\uff08\u8be5\u9009\u9879\u5728\u7248\u672c 3.3.12 \u4e0a\u53ef\u7528\uff09<\/p>\n
\u6ce8\u610f\u6bd4\u8f83\u4e0a\u9762\u6709\u7f13\u51b2\/\u7f13\u5b58\u7684\u8f93\u51fa\u3002<\/p>\n
# free -wh\r\n total used free shared buffers cache available\r\nMem: 2.0G 1.6G 137M 20M 8.1M 183M 163M\r\nSwap: 2.0G 1.8G 249M\r\n<\/pre>\n\u663e\u793a\u6700\u4f4e\u548c\u6700\u9ad8\u7684\u5185\u5b58\u7edf\u8ba1<\/div>\n\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c free \u547d\u4ee4\u4e0d\u4f1a\u663e\u793a\u6700\u4f4e\u548c\u6700\u9ad8\u7684\u5185\u5b58\u7edf\u8ba1\u3002\u4e3a\u4e86\u663e\u793a\u6700\u4f4e\u548c\u6700\u9ad8\u7684\u5185\u5b58\u7edf\u8ba1\uff0c\u5728 free \u547d\u4ee4\u540e\u9762\u52a0\u4e0a -l \u9009\u9879\u3002<\/p>\n
# free -l\r\n total used free shared buffers cached\r\nMem: 32849392 25931336 6918056 188 182424 24632808\r\nLow: 32849392 25931336 6918056\r\nHigh: 0 0 0\r\n-\/+ buffers\/cache: 1116104 31733288\r\nSwap: 20970492 0 20970492\r\n<\/pre>\n\u9605\u8bfb\u5173\u4e8e free \u547d\u4ee4\u7684\u66f4\u8fc7\u4fe1\u606f<\/div>\n\u5982\u679c\u4f60\u60f3\u4e86\u89e3 free \u547d\u4ee4\u7684\u66f4\u591a\u53ef\u7528\u9009\u9879\uff0c\u53ea\u9700\u67e5\u770b\u5176 man \u624b\u518c<\/a>\u3002<\/p>\n
# free --help\r\nor\r\n# man free\r\n<\/pre>\n
\nvia: http:\/\/www.2daygeek.com\/free-command-to-check-memory-usage-statistics-in-linux\/<\/a><\/p>\n
\u4f5c\u8005\uff1aMAGESH MARUTHAMUTHU<\/a> \u8bd1\u8005\uff1aucasFL<\/a> \u6821\u5bf9\uff1awxy<\/a><\/p>\n
\u672c\u6587\u7531 LCTT<\/a> \u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd<\/a> \u8363\u8a89\u63a8\u51fa<\/p>\n
\n\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-8314-1.html<\/a><\/p>\n