LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 03-24-2010, 03:44 PM   #1
sunny8107
LQ Newbie
 
Registered: Jul 2009
Posts: 9

Rep: Reputation: 0
Question Understanding the output of free memory


All,
I am trying to understand the out of free command. This is on a 4GB Redhat machine. This is what I get:

total used free shared buffers cached
Mem: 3108016 3063752 44264 0 142416 1696244
-/+ buffers/cache: 1225092 1882924
Swap: 2031608 1256 2030352


The output is in kilobytes.
1. Total Mem: is 3.108GB - I guess the remaining (4GB - 3.108GB) is being used by the Kernel and not displayed by the free command?

2. Buffers/Cache: Used: 1.225GB and Free: 1.8829GB
So the total buffers/cache comes out to be 1.225+1.8829 = 3.108GB - which is the same as Total Mem. So I conclude that Buffers/Cache is the Actual RAM Memory available for applications?

3. If I have to answer - what is the free memory available in this machine and why?
a) 44264KB (free Mem)
b) 1882924KB (free -/+ buffers/cache)

Thanks in advance
 
Old 03-24-2010, 03:50 PM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by sunny8107 View Post
1. Total Mem: is 3.108GB - I guess the remaining (4GB - 3.108GB) is being used by the Kernel and not displayed by the free command?
No, the Kernel is only using a little of that missing memory.

Most of it is unusable, probably because you have a non PAE kernel. You should seriously consider installing the package for a PAE kernel.

Quote:
2. Buffers/Cache: Used: 1.225GB and Free: 1.8829GB
So the total buffers/cache comes out to be 1.225+1.8829 = 3.108GB - which is the same as Total Mem. So I conclude that Buffers/Cache is the Actual RAM Memory available for applications?
No again. That line tells you total memory used and total memory free based on the interpretation that buffers and cache are equivalent to free.

In other words 1.225GB is used by things other than buffer and cache.

Last edited by johnsfine; 03-24-2010 at 03:53 PM.
 
Old 03-24-2010, 04:01 PM   #3
sunny8107
LQ Newbie
 
Registered: Jul 2009
Posts: 9

Original Poster
Rep: Reputation: 0
Question

Quote:
Originally Posted by johnsfine View Post
No again. That line tells you total memory used and total memory free based on the interpretation that buffers and cache are equivalent to free.

In other words 1.225GB is used by things other than buffer and cache.
So what does it mean by Free: 1.8829GB
Does that mean the total amount of RAM that is free? Or is the total amount of Free RAM just 44264KB?
 
Old 03-24-2010, 04:28 PM   #4
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197Reputation: 1197
Quote:
Originally Posted by sunny8107 View Post
So what does it mean by Free: 1.8829GB
Does that mean the total amount of RAM that is free? Or is the total amount of Free RAM just 44264KB?
The total buffers+cache+free is 1.8829GB.

For most practical purposes, you should consider memory used by buffers+cache to be free.

If any process needs some memory when there isn't enough free (in the narrower sense of free) the kernel will normally take memory from buffers or cache.

So in the broader sense of "free" (memory that is available for use when needed) buffers+cache is a kind of free memory.

But because there are these two senses of the word "free" for free memory, the free command gives you the information both ways (how much is used and free if you count buffers+cache as used, then how much is used and free if you count buffers+cache as free).
 
Old 09-21-2010, 02:32 PM   #5
drManhattan
Member
 
Registered: Aug 2010
Location: Warsaw, Poland
Distribution: Ubuntu 10.04 LTS on IBM Lenovo R61e, RHEL5-6,SLES10-11
Posts: 262

Rep: Reputation: 1
It is understandable but sth isn't right for me.

You says that :
Quote:
But because there are these two senses of the word "free" for free memory, the free command gives you the information both ways (how much is used and free if you count buffers+cache as used, then how much is used and free if you count buffers+cache as free).
So if I add buffers + cached it should give me used in the line below ?
142416 + 1696244 = 1838660 (!= 3063752)

Code:
total used free shared buffers cached
Mem: 3108016 3063752 44264 0 142416 1696244
What is the difference between, value of used AND cached+buffers (1225092) ?
3063752 - 1838660 = 1225092



thx for help.

Last edited by drManhattan; 09-21-2010 at 02:35 PM.
 
  


Reply



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
Understanding /var/log/messages memory output kenneho Linux - Software 7 03-10-2008 10:09 AM
Understanding the output of lspci kushalkoolwal Linux - Hardware 4 07-05-2006 11:35 PM
web browsers slow, little memory free, pleae review output from top jeffreybluml Linux - Newbie 31 07-03-2004 08:15 PM
understanding lm_sensors output Pete Dogg Linux - Software 7 10-15-2003 01:28 AM
Understanding CRON output lhoff Linux - General 1 05-19-2003 01:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:46 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
Open Source Consulting | Domain Registration