[精讚] [會員登入]
859

[CENTOS7 8] 查看記憶體

linux 中查看記憶體狀態指令整理

分享此文連結 //n.sfs.tw/15828

分享連結 [CENTOS7 8] 查看記憶體@新精讚
(文章歡迎轉載,務必尊重版權註明連結來源)
2022-05-10 13:14:08 最後編修
2022-05-10 10:05:00 By 張○○
 

自動目錄

此篇完全參考[1] 的說明做整理

一、free

# free -h
              total        used        free      shared  buff/cache   available
Mem:           5.7G        302M        245M        350M        5.1G        4.6G
Swap:          2.0G         28M        2.0G

 

二、cat /proc/meminfo

# cat /proc/meminfo
MemTotal:        5946568 kB
MemFree:          245052 kB
MemAvailable:    4849768 kB
Buffers:               0 kB
Cached:          4793488 kB
SwapCached:         1996 kB
Active:          2667892 kB
Inactive:        2243620 kB
Active(anon):     196404 kB
Inactive(anon):   281016 kB
Active(file):    2471488 kB
Inactive(file):  1962604 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       2097148 kB
...

 

三、vmstat -s

# vmstat -s
      5946568 K total memory
       297644 K used memory
      2652552 K active memory
      2243688 K inactive memory
       263648 K free memory
            0 K buffer memory
      5385276 K swap cache
      2097148 K total swap
        29156 K used swap
      2067992 K free swap
     12862316 non-nice user cpu ticks
       106196 nice user cpu ticks
      3709876 system cpu ticks
    997861015 idle cpu ticks
      1317075 IO-wait cpu ticks
...

 

四、top

# top
top - 09:53:16 up 39 days, 14:38,  1 user,  load average: 0.15, 0.11, 0.06
Tasks: 132 total,   1 running, 131 sleeping,   0 stopped,   0 zombie
%Cpu(s):  1.6 us,  0.2 sy,  0.0 ni, 97.8 id,  0.3 wa,  0.0 hi,  0.1 si,  0.0 st
KiB Mem :  5946568 total,   256764 free,   304424 used,  5385380 buff/cache
KiB Swap:  2097148 total,  2067992 free,    29156 used.  4862232 avail Mem

 

五、htop 可以查看使用比率(推薦)

htop 非原生,要安裝,在epel包中。

# yum install htop
# htop

 

六、dmidecode -t 17 查看每一個slot的狀況

# dmidecode -t 17
# dmidecode 3.0 <== 非指令
Scanning /dev/mem for entry point.
SMBIOS 2.4 present.
Handle 0x00E3, DMI type 17, 27 bytes
Memory Device
    Array Handle: 0x00E2
    Error Information Handle: No Error
    Total Width: 32 bits
    Data Width: 32 bits
    Size: 4096 MB
    Form Factor: DIMM
    Set: None
    Locator: RAM slot #0 <== 記憶體slot
    Bank Locator: RAM slot #0
    Type: DRAM
    Type Detail: EDO
    Speed: Unknown
    Manufacturer: Not Specified
    Serial Number: Not Specified
    Asset Tag: Not Specified
    Part Number: Not Specified

 

參考資料

[1] https://www.binarytides.com/linux-command-check-memory-usage/

END

你可能感興趣的文章

[Rocky9] codeignitor4+ nginx+ php8.1-fpm + docker compose 這次的目標是把服務裝在docker,裡面放入 nginx 和 php8.1-fpm的 docker container, 並採用codeignitor4。

[CENTOS7/8] 安裝中文字型 如何在Centos7上安裝和移除中文字型?

[bc] linux 的計算機 bc 設定小數位數、計算π、次方根 linux 的計算機 bc 設定小數位數、計算π、次方根

[CENTOS8] Failed to download metadata for repo 'appstream' 的問題 Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist的解決方法。

使用RRDTOOL來繪製流量圖 使用RRDTOOL來製作流量圖的簡略說明

Centos7 的ifconfig和netstat Centos7 和RHEL 7 最小安裝中竟然沒有ifconfig和netstat?原來centos/rhel準備把這兩個指令作廢,那怎麼辦?

我有話要說

>>

限制:留言最高字數1000字。 限制:未登入訪客,每則留言間隔需超過10分鐘,每日最多5則留言。

訪客留言

[無留言]

隨機好文

[jQuery] textarea 的取值和給值 HTML 的 TEXTAREA 標籤若要用 jquery 取值,不能使用 .text() 或 .html() ,使用 .

談借錢 人借錢時手心向上頭向下,人還錢時手心向下頭向上

[HP DL380G7] 生效啟動第3,4片網卡/開啟或關閉內建的網卡 HP DL380G7 預設第3,4片網卡裝完系統後找不到,難道是壞了?要怎麼辦?

[Freebsd] 定時測試 ADSL 是否斷線並重連 中華電信 ADSL 雖有固定 ip,可是他卻會不定時「斷線」, 使用以下的 方法可以定時測試是否斷線,以及重新撥接。

Linux shell 的date表示法 linux下SHELL中的date表示法