Re: About _real_ free memory

From: Jakob Oestergaard
Date: Thu Oct 16 2003 - 06:45:46 EST


On Thu, Oct 16, 2003 at 11:04:14AM +0200, Frederick, Fabian wrote:
> If a process tries to allocate and use more than the really free
> amount, some cache will be dropped automatically. From a performance
> point of view, this could of course be undesirable, but normally
> there's no need to think about it.
>
> <Why don't we have a command to drop some cache ? or maybe some
> <kernel rules to do it ? we could gain some more scalability doing that kind
> of
> <stuff during low load.

No - you would throw out disk cache with the risk of throwing out
potentially useful data. The data can be thrown out *immediately*
anyway if someone needs it.

So: gain: zero
loss: likely noticable
------------------------------
total: bad idea

>Another problem is end-user point of view :
>
> < -What's available on a box before swapping ?
> < -Do I have to add RAM right now ?

[albatross:joe] $ free
total used free shared buffers
cached
Mem: 1033944 902036 131908 0 41120
446456
-/+ buffers/cache: 414460 619484
Swap: 2101000 294552 1806448

I have 619 MB of free memory now, if you do not count in the caches.

The free physical memory is around 132 MB - this number tells me how
much memory the kernel could not find a use for (for either processes or
cache) - e.g. the amount of memory that I paid for but is not doing
anything useful.

You want the physical free memory to be as low as possible - it is the
amount of memory that is being wasted in the system by not doing
anything useful. If the user cannot understand this, they should learn
not to care either. Certainly, you should never ruin the workings of
the VM subsystem by freeing useful cache memory, just so a user who has
no understanding of what is actually going on, can get a nice big number
in his 'free' output.

Maybe one could patch the 'free' utility instead? ;)

--
................................................................
: jakob@xxxxxxxxxxxxx : And I see the elder races, :
:.........................: putrid forms of man :
: Jakob Østergaard : See him rise and claim the earth, :
: OZ9ABN : his downfall is at hand. :
:.........................:............{Konkhra}...............:
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/