1. 程式人生 > >LINUX 筆記-free 命令

LINUX 筆記-free 命令

3.1 tin abs some 物理 something 2.6.32 ubuntu stl

free命令可以顯示Linux系統中空閑的、已用的物理內存及swap內存,及被內核使用的buffer。

[email protected]:~$ free -h
total used free shared buff/cache available
Mem: 3.8G 1.3G 928M 27M 1.7G 2.2G
Swap: 4.0G 0B 4.0G

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

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

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)

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

buff/cache:Sum of buffers and cache(A buffer is something that has yet to be "written" to disk. A cache is something that has been "read" from the disk and stored for later use.)

available: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)

LINUX 筆記-free 命令