How do I check used and free RAM memory usage under Linux operating systems using command line and GUI tools?
Linux comes with different set of commands to check memory usage. The free command displays the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel. The vmstat command reports information about processes, memory, paging, block IO, traps, and cpu activity. Finally, you can use the top command which provides a dynamic real-time view of a running system. It can display system summary information as well as a list of tasks currently being managed by the Linux kernel.
free command :
第一個要介紹的是 free 命令. 透過它你可以知道記憶體使用量, 總記憶體大小等資訊 :
- Display free memory size in MB:
- Displays a line containing the totals memory in MB:
vmstat command :
如果你想要動態的瞭解一下系統資源的運作,那麼這個 vmstat 就可以派上用場!它可以偵測『 CPU / 記憶體 / 磁碟輸入輸出狀態 』等等,如果你想要瞭解一部繁忙的系統到底是哪個環節最累人, 可以使用這個命令分析看看 :
底下為顯示 items 說明 :
- Procs
- Memory
- Swap
- IO
- System
top command :
相對於 ps 是擷取一個時間點的程序狀態, top 則可以持續偵測程序運作的狀態 :
(在 console 執行 top 命令)
/proc/meminfo :
如果你僅是要記憶體的相關資訊, 你可以 cat /proc/meminfo :
Reference :
* Blog : Linux Check Memory Usage
* Blog : Linux – How to check memory usage
* 鳥哥 Linux 私房菜 > 程序管理 > free : 觀察記憶體使用情況
* 鳥哥 Linux 私房菜 > 程序管理 > vmstat : 偵測系統資源變化
沒有留言:
張貼留言