免费命令:哪一列最相关?
free command: Which column is most relevant?
我正在 运行在具有 16G RAM 的 Debian 9 云服务器上安装程序。我担心程序可能会占用内存,所以我在循环中使用 运行 'free -h' 命令。当内存消耗最大时,我在程序结束时得到以下输出:
total used free shared buff/cache available
Mem: 15G 6.4G 155M 10M 9.1G 9.0G
Swap: 511M 20K 511M
如果您查看 'free' 列,似乎只有 155M 可用,但如果您查看 'available' 列,则似乎有 9G 可用。因此,根据列的不同,我似乎只有很少的可用内存,或者有很多内存。我应该相信哪个专栏?
我咨询过'man free',但我觉得难以理解。
空闲内存此时完全未使用。这个数字通常和理想情况下会非常低,因为 OS 会尝试尽可能多地使用此内存进行缓冲和缓存。
您的应用程序 自由 可用的内存实际上已在 buffering/cached 列中提到。
如果你的程序 运行 内存不足,它会尝试通过使用 swap 来释放内存,将数据外包到 HDD 并释放内存以供使用。考虑到只使用了 20K 的交换 space 是另一个表明您的程序 不是 运行 内存不足的指标。
实际上这取决于你在什么情况下谈论内存。
看到空闲的内存是155M。
However server has set memory for buffer/cache 9.1 GB out of which 9.0 GB is
available, which can be used for apps so its unused/free
If we are concerned about system performance only , this will not degrade system performance until lot of swapping occurs .
But for new apps installation which required more than 155 MB you will get memory error as we have
only 155 MB free .
我正在 运行在具有 16G RAM 的 Debian 9 云服务器上安装程序。我担心程序可能会占用内存,所以我在循环中使用 运行 'free -h' 命令。当内存消耗最大时,我在程序结束时得到以下输出:
total used free shared buff/cache available
Mem: 15G 6.4G 155M 10M 9.1G 9.0G
Swap: 511M 20K 511M
如果您查看 'free' 列,似乎只有 155M 可用,但如果您查看 'available' 列,则似乎有 9G 可用。因此,根据列的不同,我似乎只有很少的可用内存,或者有很多内存。我应该相信哪个专栏?
我咨询过'man free',但我觉得难以理解。
空闲内存此时完全未使用。这个数字通常和理想情况下会非常低,因为 OS 会尝试尽可能多地使用此内存进行缓冲和缓存。
您的应用程序 自由 可用的内存实际上已在 buffering/cached 列中提到。 如果你的程序 运行 内存不足,它会尝试通过使用 swap 来释放内存,将数据外包到 HDD 并释放内存以供使用。考虑到只使用了 20K 的交换 space 是另一个表明您的程序 不是 运行 内存不足的指标。
实际上这取决于你在什么情况下谈论内存。
看到空闲的内存是155M。
However server has set memory for buffer/cache 9.1 GB out of which 9.0 GB is available, which can be used for apps so its unused/free
If we are concerned about system performance only , this will not degrade system performance until lot of swapping occurs .
But for new apps installation which required more than 155 MB you will get memory error as we have only 155 MB free .