
It reports lots of information about the installed RAM memory. To find out hardware information about the installed RAM, use the demidecode command. Similar to the top command, the htop command also shows memory usage along with various other details. The next way to check memory usage is to read.
#Linux see free memory free
The buffer and cache information is present here too, like the free command. The free command is the most simple and easy to use command to check memory usage on linux. They indicate total, used and free amounts of the memory. Here is a sample outputĬheck the KiB Mem and KiB Swap lines on the header. The header on output has the required information. However it also reports total memory usage and can be used to monitor the total RAM usage. The top command is generally used to check memory and cpu usage per process. The vmstat command with the s option, lays out the memory usage statistics much like the proc command. They indicate same values of memory usage as the free command. They are rather virtual files that contain dynamic information about the kernel and the system.Ĭheck the values of MemTotal, MemFree, Buffers, Cached, SwapTotal, SwapFree. Know that the /proc file system does not contain real files. The next way to check memory usage is to read the /proc/meminfo file. The free command is the most simple and easy to use command to check memory usage on linux. Now, Total Available ( 7869) - Actual Used ( 696) should give you the free memory which is 7173 in this case which is also got as output in the second line.Just in case anyone found the title interesting enough: free -m

It returns me 697 which is the actual used RAM output in the second line.

Total used ( 4402) - Total buffer RAM ( 208) - Total RAM for caching( 3497) should constitute the Actual used RAM in the system.
#Linux see free memory how to
How to calculate the values 6 obtained in Line2?

I am going to mention on how to parse the information on free command. Memory that is already in use, that is, memory that is available but not free, can easily be switched to another use. Memory that is free is actually harder to use because it has to be transitioned from free to in use. To output used memory (minus buffers and cache) you can use a command like: % free | awk 'FNR = 3 ' Modern operating systems go out of their way to keep as little memory free as possible. There is no buffer or cache for swap as it would not make sense to put these things on a physical disk. The final line ( Swap) gives the usage of swap memory. Linux Open the command line Type the following command: grep MemTotal /proc/meminfo You should see something similar to the following as output: MemTotal. The next line ( -/+ buffers/cache:) gives us the actual used and free memory as if there were no buffers or cache. This is not your "true" free memory because the system will dump cache if needed to satisfy allocation requests. In this line used includes the buffers and cache and this impacts free. Using the free command, you can get information about. Mem: 24683904 20746840 3937064 254920 1072508 13894892 For this purpose, Linux free command is used to display the complete summary or a report of memory usage.
