This wiki was updated to MediaWiki 1.37. If you notice any issues, please report them to admin[at]

User:Tsu2/free tool

Jump to: navigation, search


The Unix memory tool
Used to display memory availability and usage.


The following is a snapshot running free
Free output.png

Notice that this information is also displayed running top (the upper section)
Top topsection.png

Description of Values

This section describes what each value means, the first cell in each row
the first (Mem/swap) refers to the row and
the second refers to the column

The first row

Mem Total Total configured RAM (does not include swap)
Mem used RAM in use (does not include swap)
Mem free Unallocated RAM
Mem shared

The second line of output requires some explanation. In the course of operations, the OS will retrieve data from the disk, "buffers" and cache" describes the "data from disk." In a way, think of these as "reverse swapping" where in this case the original data is on disk but is copied to RAM for faster processing. Swapped data is the reverse where the original data is in memory but is pushed to disk to make room for higher priority data. Because these normally "free" blocks are allocated, they are reported as part of "used" (but of course can be unallocated easily with the consequence the data would have to be re-read from disk - See below for a command that does just this).

Mem buffers Free memory usable as I/O disk blocks
Mem cached Normally free memory used as I/O disk blocks

Note: Although the values first line is often used as described above, the "adjusted" values in line 2 which follows now(-/+) are often more useful.
The second row

-/+ used Mem used minus (buffers + cached) = (Adjusted) used memory without memory allocated for disk data in memory
-/+ free Mem free plus (buffers + cached) = (Adjusted) free memory with memory allocated for disk data in memory

The third row

Swap total Total disk space available for swapping data from memory to disk
Swap used Disk space in use as data swapped from memory
Swap free Unused swap space on disk

Lastly, people may wonder what that "shared" column is. It's obsolete and should never contain a value although it continues to exist maybe to pique inquiring minds.

Command to Clear Buffers and Cache

After performing heavy tasks for a period of time, before changing to running something else heavy and unrelated it can be useful to manually clear the buffers and cache because of course the existing cache is only relevant to tasks which will no longer be performed. The following command clears and resets. Although it's not quite the same as rebooting altogether, it's usually very sufficient

sh -c "sync; echo 3 > /proc/sys/vm/drop_caches"

Additional utilities which can provide more granular or additional information displayed by free