Linux下free命令各字段的含义


因为最近有用,搜了一下,整理如下:

free -m

total used free shared buffers cached

Mem: 3791 3360 430 0 71 2409

-/+ buffers/cache: 879 2912

Swap: 1004 0 1003

第一行是从系统角度看的,total = used + free。buffers和cached都是系统已经分配好的buffer和cache。

第二行才是应用程序可用的同样 total = used2 + free2。buffer/cached是为了提高文件读取的性能,当应用程序需在用到内存的时候,buffer/cached会很快地被回收。

相关内容