Master Linux Memory Monitoring: The Complete Guide to the free Command
Learn how to use the Linux free command to display detailed memory and swap statistics, understand each field—including total, used, free, buffers, cached, and available—interpret the output correctly, and apply common options for human‑readable, periodic, and comprehensive reporting.
This article provides a thorough guide to the Linux free command, which shows statistics about physical memory and swap usage.
Metric Explanation
total : total physical memory (total = used + free)
used : memory in use, including applications, buffers, and cache
free : amount of idle memory
shared : shared memory amount
buffers : cache used by block devices
cached : cache of regular file data
available : total memory readily available for new applications (does not include swap)
For the available field, kernels ≥ 3.14 read it from /proc/meminfo (MemAvailable); older kernels simulate it, otherwise it equals the free value.
Adjusted values –/+ buffers/cache
used : memory used by applications after subtracting buffers and cache
free : true free memory, i.e., idle memory plus buffers and cache
Swap usage statistics
total : total swap space
used : swap currently in use
free : unused swap space
Normal conditions (no cause for alarm)
Free memory ( free) is close to 0.
Used memory ( used) is close to total.
Available memory ( free+buffers/cache) exceeds 20% of total.
Swap usage remains unchanged.
Low‑memory warnings
Available memory ( free+buffers/cache) is very low, approaching 0.
Swap usage ( swap used) increases or fluctuates.
Output of dmesg | grep oom-killer shows an Out‑Of‑Memory killer running.
Common options
-b/k/m/g : display results in bytes, kilobytes, megabytes, or gigabytes.
-h : human‑readable format.
-t : add a total line.
-o : omit the second line with adjusted buffers/cache values.
-s : refresh output every specified number of seconds.
-c : limit the number of refreshes (used with -s).
-l : show detailed low and high memory statistics.
-a : display available memory.
-V : show version information.
Reference example
# free -t -a -gSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
