LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-19-2004, 07:36 PM   #1
robbiemorgan
LQ Newbie
 
Registered: Aug 2003
Posts: 19

Rep: Reputation: 0
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
 
Old 09-19-2004, 07:43 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 47
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.

Last edited by leonscape; 09-19-2004 at 07:45 PM.
 
Old 09-19-2004, 07:57 PM   #3
robbiemorgan
LQ Newbie
 
Registered: Aug 2003
Posts: 19

Original Poster
Rep: Reputation: 0
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
 
Old 09-19-2004, 08:02 PM   #4
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 52
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.
 
Old 09-19-2004, 08:05 PM   #5
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 47
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Still having Free memory issues..? sspiro Linux - Software 14 04-07-2005 07:13 PM
free memory from strtok? swinchen Programming 1 09-09-2004 12:01 AM
Free memory disappearing Vampyric Linux - General 2 02-17-2004 09:40 PM
Memory missing from 'free' simonburton Linux - General 3 11-19-2003 09:24 AM
Memory free problem edreddy Programming 1 11-09-2002 11:59 PM


All times are GMT -5. The time now is 10:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration