我不明白这一点。当free -m显示以下内容时:
total used free shared buffers cached
Mem: 15334 14025 1308 0 258 10918
-/+ buffers/cache: 2848 12485
Swap: 953 0 953这是否意味着我的第1行有1.4GB的免费,或者第2行有12 or的免费?
我有Linux + Nginx + php-fpm + Mysql + Memcached
编辑:
我知道1.3GB是空闲的未使用内存,但是如果我们删除缓冲区的使用,实际上我的vps上有12 on的空闲内存。这是否意味着16 my的vps比我所需要的要高得多,而且我把它浪费在一台大机器上,因为它有12 my的免费空间?或者看第1行,我是否认为缓冲区使用了大量内存,这意味着我的机器仍然从大量的ram中受益,因为缓冲区的使用意味着更快的响应?
发布于 2015-02-03 18:52:33
第一行显示了考虑(添加) cache和buffers的内存使用情况,即用于缓存数据或缓冲I/O的内存的一部分。
另一方面,第二行显示内存使用情况,不考虑(推导) cache和buffers。
现在,您可能想知道,如果一个新进程需要更多的内存,而不是在第一行(即考虑cache/buffers )中显示,那么在这个缓存中,cache中最古老的数据将被清除,以便为最新的进程腾出空间。因此,您不必担心缓存/缓冲所占用的巨大空间。
更多的缓存意味着更快的响应。所以,除非它绝对困扰着你,否则你对此很在行。
发布于 2015-02-03 18:56:48
我建议免费查看手册页(见下面的摘录):
# man freeNAME
free - Display amount of free and used memory in the system
SYNOPSIS
free [options]
DESCRIPTION
free displays the total amount of free and used physical and swap memory in the system, as well as the buffers and caches used by the kernel. The information is gath‐
ered by parsing /proc/meminfo. The displayed columns are:
total Total installed memory (MemTotal and SwapTotal in /proc/meminfo)
used Used memory (calculated as total - free)
free Unused memory (MemFree and SwapFree in /proc/meminfo)
shared Memory used (mostly) by tmpfs (Shmem in /proc/meminfo, available on kernels 2.6.32, displayed as zero if not available)
buffers
Memory used by kernel buffers (Buffers in /proc/meminfo)
cached Memory used by the page cache (calculated as Cached - Shmem in /proc/meminfo - the Cached value is actually the sum of page cache and tmpfs memory)https://unix.stackexchange.com/questions/182723
复制相似问题