home | list info | list archive | date index | thread index

Re: [OCLUG-Tech] How to find extended system information?

Brenda J. Butler wrote:
: Take the /proc/meminfo data with a grain of salt.  Last I heard
: (unfortunately too long ago) Linux used lazy release of memory pages,
: meaning it keeps stuff around in memory until someone else needs it.
: So the reported "free" memory is often much lower that what is
: really available.

Can you explain that a bit further?  Everything I know about Linux memory
management (albeit not all that much) is quite the opposite: the amount of
free memory is significantly higher than what is listed under "free".

Memory that has been buffered or cached is not actively in use, but it still
held on to by the kernel.  It isn't freed until the memory is actively
required; this means that the OS can frequently reference in-memory copies
of files (or other data) without needing to re-read them from disk.

I can't find the IBM paper detailing this behaviour, but a quick Google
search can turn up any number of resources:

    <http://www.freshblurbs.com/how-profile-memory-linux>

To determine available RAM, the rule of thumb is free+buffered+cached.  Free
memory alone isn't really a great measure of how much memory is actually,
erm, free.

(Note that other OSes perform very similarly, with minor tweaks.)

(Conversely, the only reliable way to determine if you need *more* memory on
a Linux system is to see if swap is being used for normal activities.  If it
is, you've run out of physical RAM.  If it isn't, you have sufficient RAM.)