United States (change)
Shortcuts: Downloads Fedora Red Hat Network
Account Links: Cart Your Account Logout
The philosophy in Linux is that an unused resource is a wasted resource. The kernel therefore will use as much RAM as it can to cache information from your local and remote filesystems/disks. This builds up over time as reads and writes are done on the system trying to keep the data stored in RAM as relevant as possible to the processes that have been running on your system. This caching is reported by the system as the sum of two numbers, buffers and pagecache. The cache is reclaimed, not at the time of process exit (you might start up another process soon that needs the same data), but upon demand - i.e. When you start a process that needs a lot of memory to run, the Linux kernel will reclaim memory that had been storing cached data and give it to the new process.
There are some things which get reported as cache which are not directly freeable by the kernel, such as anonymous mmaps and shm regions. These will however, report against all processes attached to them unlike normal cache which is not part of the address space of any running process but is simply a kernel mapping.
For example (Units are in megabytes):
# free -m
total used free shared buffers cached
Mem: 1000 900 100 0 350 350
-/+ buffers/cache: 200 800
In this example, as far as applications are concerned the system is using only 200MB of memory and has 800MB free and available for use if needed.
The items to note here are:
<Physically Used Memory> = <Actual used memory> + <buffers> + <cache> <Physically Free Memory> = <Total Physical Memory> - <Actual used memory> - <buffers> - <cache> <Memory free for Applications> = <Total Physical Memory> - <Actual used memory> <Memory used by Applications> = <Actual used memory> - <buffers> - <cache>