Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is available and free memory in response of free command on Linux? [closed]

The output of the free command that I fired on my Linux host is as below:

free               total        used        free      shared  buff/cache   available Mem:      263846320    47746620     3290072     1140808   212809628   214382420 Swap:             0           0           0 

I am not able to figure out what this available part is specifying. The free memory is very less shown i.e around 1.24% even though the total memory is way high and used memory is around 18.09% only.

free -h               total        used        free      shared  buff/cache   available Mem:           251G         45G        3.1G        1.1G        202G        204G Swap:            0B          0B          0B 

Does it mean I won't be able to start more applications as free memory is very less? The used memory is 18% only. So shouldn't free memory be 82% and not 1.24% as the command is showing above?

I am confused. Can anyone help?

like image 302
Nishant Lakhara Avatar asked Jan 02 '17 12:01

Nishant Lakhara


People also ask

What is available and free memory in Linux?

available memory in Linux is, that free memory is not in use and sits there doing nothing. While available memory is used memory that includes but is not limited to caches and buffers, that can be freed without the performance penalty of using swap space.

Which command is used to check free RAM memory do I have available on my Linux system?

Entering cat /proc/meminfo in your terminal opens the /proc/meminfo file. This is a virtual file that reports the amount of available and used memory. It contains real-time information about the system's memory usage as well as the buffers and shared memory used by the kernel.

What is available column in free command?

The available column estimates how much memory is available for starting new applications without swapping. In figure 2 above, the total installed RAM is 15 GB, used is 751 MB, and free is 1.2 GB.

What is available memory in free M?

In the output of free , Free memory is the amount of memory which is currently not used for anything. This number should be small, because memory which is not used is simply wasted. Available memory is the amount of memory which is available for allocation to a new process or to existing processes.


1 Answers

Modern operating systems go out of their way to keep as little memory free as possible. Memory that is free is actually harder to use because it has to be transitioned from free to in use. Memory that is already in use, that is, memory that is available but not free, can easily be switched to another use.

All this is normal. Free memory is wasted and does not make your system faster.

If you're thinking "but I want my memory free now so I can use it later", realize that this makes no sense. You can't save memory for later. A system with 4GB that uses 2GB today can't use 6GB tomorrow. You can use your memory both now and later. There is no tradeoff here -- using memory is free. The only alternative to using memory is wasting it. Why would you want your system to waste more memory?

like image 91
David Schwartz Avatar answered Sep 21 '22 11:09

David Schwartz