free命令

-- TOC --

free命令用来查看系统内存和swap空间信息,它的信息来自/proc/meminfo。一般用法:free -h

free命令有一个-s参数,后面跟一个间隔时间,每这么长时间重新显示一次,但我觉得还是配合watch命令比较酷...

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 gathered by parsing /proc/meminfo. The displayed columns are:

Total installed memory (MemTotal and SwapTotal in /proc/meminfo)

total 列显示系统总的可用物理内存和交换空间大小。

Used memory (calculated as total - free - buffers - cache)

Unused memory (MemFree and SwapFree in /proc/meminfo)

Memory used (mostly) by tmpfs (Shmem in /proc/meminfo)

Memory used by kernel buffers (Buffers in /proc/meminfo)

Memory used by the page cache and slabs (Cached and SReclaimable in /proc/meminfo)

Sum of buffers and cache

Estimation of how much memory is available for starting new applications, without swapping. Unlike the data provided by the cache or free fields, this field takes into account page cache and also that not all reclaimable memory slabs will be reclaimed due to items being in use (MemAvailable in /proc/meminfo, available on kernels 3.14, emulated on kernels 2.6.27+, otherwise the same as free)

本文链接:https://cs.pynote.net/sf/linux/shell/202112103/

-- EOF --

-- MORE --