Summary

A practical reference covering four methods for monitoring memory usage on Linux systems: the free command, interactive process viewers (htop/top/btop++), the /proc/meminfo virtual file, and GUI system monitors. Each method is explained with what it displays and when to use it, making this a quick-reference guide for sysadmins and DevOps engineers diagnosing memory issues.

一篇實用的 Linux 記憶體監控參考指南,涵蓋四種方法:free 指令、互動式程序查看器(htop/top/btop++)、/proc/meminfo 虛擬檔案,以及 GUI 系統監控器。適合系統管理員和 DevOps 工程師快速診斷記憶體問題。

Key Points

  • free -h: shows total/used/free/buff-cache/available in human-readable format; availablefree (buff/cache is reclaimable)
  • buff/cache is not wasted memory — it can be reclaimed by applications at any time
  • htop/top/btop++: real-time per-process %MEM column plus system summary header
  • /proc/meminfo: the raw source file that all other tools (free, htop, ps) read from; parseable in shell scripts
  • GUI system monitor (GNOME): useful for historical visualization of memory trends, though rare in production sysadmin workflows

Insights

  • The available column in free is more useful than free for capacity planning — it accounts for reclaimable cache, which is the actual headroom for new processes
  • /proc/meminfo being the authoritative source means all other tools are just formatted views of the same data; scripting against it directly removes tool dependencies
  • This article pairs directly with the DevOps 6-month roadmap in this vault: Linux Month 1 covers exactly these diagnostic skills — knowing where memory lives is foundational before debugging process crashes

Connections

Raw Excerpt

The simplest method to check RAM memory use is to display the contents of the /proc/meminfo virtual file. This file is utilized by the free, htop, top, ps, and other system information commands.