What is difference between total and free memory
25,054
man free
command solve my problem.
DESCRIPTION
free displays the total amount of free and used physical and swap mem‐
ory in the system, as well as the buffers and caches used by the ker‐
nel. The information is gathered by parsing /proc/meminfo. The dis‐
played columns are:
total Total installed memory (MemTotal and SwapTotal in /proc/meminfo)
used Used memory (calculated as total - free - buffers - cache)
free Unused memory (MemFree and SwapFree in /proc/meminfo)
shared Memory used (mostly) by tmpfs (Shmem in /proc/meminfo, available
on kernels 2.6.32, displayed as zero if not available)
buffers
Memory used by kernel buffers (Buffers in /proc/meminfo)
cache Memory used by the page cache and slabs (Cached and Slab in
/proc/meminfo)
buff/cache
Sum of buffers and cache
available
Estimation of how much memory is available for starting new
applications, without swapping. Unlike the data provided by the
cache or free fields, this field takes into account page cache
and also that not all reclaimable memory slabs will be reclaimed
due to items being in use (MemAvailable in /proc/meminfo, avail‐
able on kernels 3.14, emulated on kernels 2.6.27+, otherwise the
same as free)
Author by
Hafiz Muhammad Shafiq
Updated on September 18, 2022Comments
-
Hafiz Muhammad Shafiq over 1 year
I have a desktop system where Centos 7 is installed. It has 4 core and 12 GB memory. In order to find memory information I use
free -h
command. I have one confusion.[user@xyz-hi ~]$ free -h total used free shared buff/cache available Mem: 11G 4.6G 231M 94M 6.8G 6.6G Swap: 3.9G 104M 3.8G
In total column, It is saying that total in 11GB (that's correct), in last column available, it is saying that 6.6GB and used is 4.6G.
If used memory is 4.6GB then remaining should be 6.4 GB (11-4.6=6.4). What is correct interpretation of above output What is the difference between total and available and free memory? Am I out of memory is above case if I need 1 GB more for some new application?