Using Ubuntu 14.02 and running the command cat /proc/meminfo, I get the following:
MemTotal: 1007796 kB
MemFree: 64248 kB
MemAvailable: 64876 kB
I'd like to know the exact difference between MemFree and MemAvailable. Also any hints as to how I could more efficiently use system resources would be appreciated. I have a new laptop on order, but for the moment, I'm developing on a machine with 1Gb of RAM.
Note: I was running two terminals and eclipse at the time of the command, so you can see how it's tough to multi-task.
Thanks in advance.
Rik van Riel's comments when adding MemAvailable to /proc/meminfo:
/proc/meminfo: MemAvailable: provide estimated available memory
Many load balancing and workload placing programs check /proc/meminfo to estimate how much free memory is available. They generally do this by adding up "free" and "cached", which was fine ten years ago, but is pretty much guaranteed to be wrong today.
It is wrong because Cached includes memory that is not freeable as page cache, for example shared memory segments, tmpfs, and ramfs, and it does not include reclaimable slab memory, which can take up a large fraction of system memory on mostly idle systems with lots of files.
Currently, the amount of memory that is available for a new workload, without pushing the system into swap, can be estimated from MemFree, Active(file), Inactive(file), and SReclaimable, as well as the "low" watermarks from /proc/zoneinfo.
However, this may change in the future, and user space really should not be expected to know kernel internals to come up with an estimate for the amount of free memory.
It is more convenient to provide such an estimate in /proc/meminfo. If things change in the future, we only have to change it in one place.
Free ram is actually left by the kernel, not registering that memory blocks for use.
Available Memory is the registered memory blocks with kernel, and ready to use immediately.
Verdict: We should consider Available Memory as free ram. Extra room to run more application.
MemAvailable: The amount of memory, available for starting new applications, without swapping.
MemFree: The amount of physical RAM, in kibibytes, left unused by the system.
Though we read English, the definition is not clear enough to users. Is MemAvailable refer to software or even user space? What does applications mean? Other than swapping, hugepage included? What about directmap? And kernelpage?
It is again anology problem, that is to say "The name that can be named is not a Constant Name."
Back to reality, what we really want to know is how to calculate or at least which is bigger.
ARM-based sample
# cat /proc/meminfo
MemTotal: 1053938048 kB
MemFree: 1050967832 kB
MemAvailable: 1047631704 kB
Buffers: 14972 kB
Cached: 125416 kB
SwapCached: 0 kB
Intel-based Sample
$ cat /proc/meminfo
MemTotal: 65960628 kB
MemFree: 37493412 kB
MemAvailable: 64537424 kB
Buffers: 5899700 kB
Cached: 19890832 kB
SwapCached: 8672 kB
Sadly after openning two monthly-pay servers, the problem is more complex, is CPU related?
OK, back to English again. https://www.merriam-webster.com/dictionary/
free: not costing or charging anything
available: present or ready for immediate use
So take the tables as an example for memory. When we go to restraut, sometimes there are free tables but they are not available; and there are available tables but no more free tables.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With