LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How much memory is really 'free'? (https://www.linuxquestions.org/questions/linux-newbie-8/how-much-memory-is-really-%27free%27-232672/)

robbiemorgan 09-19-2004 06:36 PM

How much memory is really 'free'?
 
Hi all,

Here's a typical sample of what I get when I run 'free':

total used free shared buffers cached
Mem: 1015300 989884 25416 0 71988 780236
-/+ buffers/cache: 137660 877640
Swap: 2104504 0 2104504


I'd really appreciate it if someone would explain to me what is meant by 'buffers' and 'cached', how much memory is *really* left for me to use, and most importantly, whether I should be worried that I appear to be using 99% of available memory!

Thanks in advance,

Rob

leonscape 09-19-2004 06:43 PM

free -m will give you the values in Mb which might be usefull.

Buffers and cache, are used by Linux to keep things efficent, but may have nothing in them that you can't lose, so you can usually deduct that from the actual memory used. The Cache and buffers, will decrease as other things demand memory.

You haven't touched swap, so obviously your doing nothing that demands more memory than you have.

Buffers: are used for accessing things, like disks and networks.
Cache: things you've recently accessed or might potentially access, so Linux won't have to go get them of the disk again.

robbiemorgan 09-19-2004 06:57 PM

Hi leonscape,

Thanks for your reply.

So in theory, I've got a good 850MB to grow into?

Surely though, it's allocated to buffers and cache for a reason - if I eat into it with more httpd and mysql processes, will performance suffer?

How far would I have to go 'til I touched swap? Clearly something I don't want to happen.

Thanks,

Rob

foo_bar_foo 09-19-2004 07:02 PM

i think personally you are looking at the situation in an old way..
all memory in linux is virtual and all 100% is available (accept what's used for the memory map itself) for use by every running proccess.

the only thing you need to think about is swap used = 0.
therefore you system is not meeting any of the watermarks for being low on memory pages per zone
that cause swapping.....
the buffers section is ram that is mapped to the hard drive for faster reads and writes
the cache are loaded pages that aren't currently in use but are there for instant access should they be needed.
i guess from a traditional standpoint you should consider buffers and cache free memory
but like i said earlier ALL memory is free memory and nothing is loaded into memory at all.

leonscape 09-19-2004 07:05 PM

That a difficult question to answer, it depends on how much stuff your really throwing at it. I mean how longs a piece of string?

Linux will try to give you the best performance it can, of course the bigger your cache, and buffers the better performance ( Although its a deminishing returns thing ). So it makes it as big as possible. So if you add more memory the bigger they'll get.

As soon as you start to do more they'll get smaller, once they get too small or something demands even more you'll start to hit swap, which is very slow.


All times are GMT -5. The time now is 09:30 AM.