Senior
What are 'free' and 'available' in the output of the 'free' command? What is the difference?
sobes.tech AI
Answer from AI
In the output of the free command in Linux:
- free is the amount of memory that is not used at all at the moment, meaning it is completely free and available for new processes.
- available is an estimate of memory that can be used without swapping, including free memory and part of the memory used for cache and buffers that can be quickly freed.
The difference is that available shows a more realistic amount of memory accessible to applications, considering that some used memory can be freed if necessary, whereas free is only the memory that is completely free.
Example output:
total used free shared buff/cache available
Mem: 8000000 3000000 500000 200000 4500000 4200000
Here, free is 500000, and available is 4200000, indicating that significantly more memory is actually available than just the free memory.