free

查看内存的使用情况

free 选项
选项 说明
-b, --bytes 以字节(Byte)为单位显示
-k, --kilo 以千字节()为单位显示
-m, --mega 以兆字节(MegaByte)为单位显示
-g, --giga 以吉字节(GigaByte)为单位显示
--tera 以太字节(TeraByte)为单位显示
-h, --human 自动决定更友好的显示单位
--si 使用1000而不使用1024进位
-t, --total 显示总计行

输出详解

[root@zhujipeng /]# free -m
             total       used       free     shared    buffers     cached
Mem:          1999        268       1730        161          5        166
-/+ buffers/cache:         97       1901
Swap:         3994          0       3994
输出 说明
total 物理内存总数
used 已经使用的内存数
free 空闲的内存数
shared 多个进程共享的内存数
buffers Buffer缓存内存数
cached Page缓存内存数
-buffers/cache 减去buffers/cache后使用的内存数
+buffers/cache 加上buffers/cache后剩余的内存数
Swap 交换分区,虚拟内存

free + buffers + cached + Swap 是实际可用的内存



参考

显示系统中空闲和已使用的内存
Linux 内存 buffer 和 cache 的区别
What is the difference between buffer vs cache memory in Linux
Linux Swap交换分区介绍总结
Linux 内存中Page cache和buffer cache 的区别
linux系统缓存机制
Linux 内核的文件 Cache 管理机制介绍
手工释放linux内存——/proc/sys/vm/drop_cache

Copyright © zhujipeng 2017 all right reserved,powered by Gitbook 该文件修订时间: 2017-11-04 14:57:24

results matching ""

    No results matching ""