1、输出简介
Mem | 行(第二行)是内存的使用情况 |
Swap | 行(第三行)是交换空间的使用情况 |
total | 列显示系统总的可用物理内存和交换空间大小 |
used | 列显示已经被使用的物理内存和交换空间 |
free | 列显示还有多少物理内存和交换空间可用使用 |
shared | 列显示被共享使用的物理内存大小 |
buff/cache | 列显示被 buffer 和 cache 使用的物理内存大小 |
available | 列显示还可以被应用程序使用的物理内存大小 |
2、free命令
[root@Tseng-HW ~]# free
total used free shared buff/cache available
Mem: 3825352 3515708 124480 35012 185164 80076
Swap: 0 0 0
[root@Tseng-HW ~]#
3、free -h 命令友好输出内存大小
[root@Tseng-HW ~]# free -h
total used free shared buff/cache available
Mem: 3.6Gi 3.4Gi 105Mi 34Mi 195Mi 70Mi
Swap: 0B 0B 0B
[root@Tseng-HW ~]#
4、持续的观察内存的状况,此时可以使用 -s 选项并指定间隔的秒数,按ctrl+c结束持续打印
[root@Tseng-HW ~]# free -h -s 3
total used free shared buff/cache available
Mem: 3.6Gi 3.4Gi 104Mi 34Mi 196Mi 69Mi
Swap: 0B 0B 0B
total used free shared buff/cache available
Mem: 3.6Gi 3.4Gi 104Mi 34Mi 196Mi 69Mi
Swap: 0B 0B 0B
total used free shared buff/cache available
Mem: 3.6Gi 3.4Gi 104Mi 34Mi 196Mi 69Mi