1. 程式人生 > >free 記憶體檢視命令

free 記憶體檢視命令

free 命令

記憶體檢視命令
-m 按照MB大小顯示記憶體大小
-h 在具體的數值後按照適合的單位顯示

[[email protected] ~]# free
              total        used        free      shared  buff/cache   available
Mem:        1865276      816452      369100       11328      679724      839048
Swap:       4194300           0     4194300
#total 總記憶體大小
#used 使用記憶體
#free 剩餘記憶體
#buff/cache 快取記憶體大小 
#00001(磁碟)-->記憶體(cache)-->cpu
#cpu-->記憶體(buff)-->00001(磁碟)
#total=used+free+buff/cache
#available包含free和/buff/cache剩餘部分
  • free -m
    指定MB單位顯示數值
[[email protected] ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:           1821         797         360          11         663         819
Swap:          4095           0        4095

  • free -g
    指定顯示單位為GB顯示數值
[[email protected]
~]# free -g total used free shared buff/cache available Mem: 1 0 0 0 0 0 Swap: 3 0 3
  • free -h
    根據數值大小顯示合適的單位
[[email protected] ~]# free -h
              total        used        free      shared  buff/cache   available
Mem:           1.8G        797M        360M         11M        663M        819M
Swap:          4.0G          0B        4.0G