Operations 7 min read

Why Linux ‘Ate My RAM’: Understanding free, buffers, and cache

Linux appears to consume most of a system’s RAM, but the free command’s output, including buffers and cache, actually reflects memory used for performance optimization; this article explains the distinction, how to interpret free’s columns, and demonstrates the impact with a 1 GB file read experiment.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Why Linux ‘Ate My RAM’: Understanding free, buffers, and cache

When Windows Explorer shows memory usage above 80%, running large programs feels sluggish because swapping occurs; on Linux, the free command often shows high memory usage even when few applications run, which is due to Linux’s memory management design.

free command introduction

Running free -m on a lab file server yields output such as:

Mem: total=3920MB, used=1938MB, free=1982MB, shared=0MB, buffers=497MB, cached=1235MB

free command output
free command output

Buffers are data waiting to be written to disk, while cache holds data read from disk for future use; both improve I/O performance.

Subtracting buffers and cache from used memory gives the amount actually occupied by applications (205 MB), and adding them to free memory gives the true amount of memory available to programs (3714 MB).

Swap space is unused in this example, indicating sufficient RAM.

Memory classification

From the OS and user perspectives, memory can be categorized as:

Used : memory taken by applications.

Free (available) : memory not used for anything.

Buffers/Cache : memory used by the kernel for I/O caching; it can be reclaimed quickly for applications, so users often consider it free.

Therefore, the third line of free output (‑/‑ buffers/cache) shows memory usage from the user’s viewpoint.

Benefits of buffers/cached

Linux employs buffer cache and page cache to speed up disk I/O. Data read from slow block devices is kept in memory, allowing subsequent accesses to bypass the disk. When memory becomes scarce, the kernel can drop cached pages instead of swapping, preserving performance.

Experiment proof

An experiment reads a 1 GB file twice:

Generate a 1 GB file.

generate 1GB file
generate 1GB file

Clear the cache.

clear cache
clear cache

Read the file and measure time (≈18 s).

first read time
first read time

Read the file again (≈0.3 s), a 60‑fold speedup thanks to caching.

second read time
second read time

References

Discussion on “Linux ate my RAM” (Google Groups).

linuxatemyram.com article.

Additional experiments on cache impact.

Blog post introducing the free command.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

performanceCacheMemory ManagementLinuxfree commandBuffers
MaGe Linux Operations
Written by

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.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.