LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 12-06-2013, 02:49 AM   #1
manoj.linux
Member
 
Registered: Aug 2007
Posts: 284

Rep: Reputation: 17
Question free and top command.


Hi,

I have used top and free command.

I would like to know why there is difference in buffers for using top and free command?
 
Old 12-06-2013, 04:04 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
There shouldn't be a difference.

How did you test this?
- If you run top and free side-by-side the amount shown should be the same.
- If you run one after the other there is a chance that the amount shown differs.
 
Old 12-06-2013, 04:06 AM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Buffers are always being allocated/freed, so changes continually. Top and free both use /proc/meminfo as source of their output, so should be mighty close.
Make sure you use kilobytes as the comparison.
 
Old 12-06-2013, 04:29 AM   #4
manoj.linux
Member
 
Registered: Aug 2007
Posts: 284

Original Poster
Rep: Reputation: 17
Quote:
Originally Posted by syg00 View Post
Buffers are always being allocated/freed, so changes continually. Top and free both use /proc/meminfo as source of their output, so should be mighty close.
Make sure you use kilobytes as the comparison.
Basically I would like to know.

from below output.How to read or relate one marked in bold

[test]$ free -m
total used free shared buffers cached
Mem: 129176 92753 36423 0 2268 39973
-/+ buffers/cache: 50511 78664
Swap: 31996 0 31996

[test ~]$ top
top - 12:31:48 up 7 days, 1:26, 3 users, load average: 0.75, 1.12, 1.20
Tasks: 995 total, 1 running, 994 sleeping, 0 stopped, 0 zombie
Cpu(s): 3.3%us, 1.2%sy, 0.0%ni, 95.4%id, 0.0%wa, 0.0%hi, 0.1%si, 0.0%st
Mem: 132276504k total, 94983252k used, 37293252k free, 2322436k buffers
Swap: 32764556k total, 0k used, 32764556k free, 40933180k cached
 
Old 12-06-2013, 04:49 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Code:
             total       used       free     shared    buffers     cached
Mem:        129176      92753      36423          0       2268      39973
-/+ buffers/cache:      50511      78664
Swap:        31996          0      31996

[test ~]$ top
top - 12:31:48 up 7 days,  1:26,  3 users,  load average: 0.75, 1.12, 1.20
Tasks: 995 total,   1 running, 994 sleeping,   0 stopped,   0 zombie
Cpu(s):  3.3%us,  1.2%sy,  0.0%ni, 95.4%id,  0.0%wa,  0.0%hi,  0.1%si,  0.0%st
Mem:  132276504k total, 94983252k used, 37293252k free,  2322436k buffers
Swap: 32764556k total,        0k used, 32764556k free, 40933180k cached
Like I said, if you used kilobytes in the free command it would be more obvious - and use [code] tags to maintain the display.

The +/- line refers to adjusting the memory usage by the buffer/cache amounts. Helps to equate the numbers in the GUI monitors.

Last edited by syg00; 12-06-2013 at 04:51 AM. Reason: Added +/- comment
 
Old 12-06-2013, 04:55 AM   #6
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Those 2 aren't related.

free:
Code:
             total       used       free     shared    buffers     cached
Mem:      12326940    2479260    9847680          0     139588    1551800
-/+ buffers/cache:     787872   11539068
Swap:      5857272          0    5857272
top:
Code:
Tasks: 353 total,   2 running, 350 sleeping,   0 stopped,   1 zombie
Cpu(s):  0.3%us,  0.2%sy,  0.0%ni, 99.5%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  12326940k total,  2478756k used,  9848184k free,   139588k buffers
Swap:  5857272k total,        0k used,  5857272k free,  1551800k cached
EDIT: Too slow......
 
  


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
Comparing Cached Free Memory with Top, Meminfo, and Free dman777 Linux - Software 2 04-27-2013 10:03 AM
Inconsistencies between top and free grob115 Linux - Newbie 12 05-16-2010 10:37 AM
LXer: Can You Top This? 15 Practical Linux Top Command Examples LXer Syndicated Linux News 0 01-09-2010 09:42 PM
What does free memory mean in top? blittrell Linux - Newbie 3 08-05-2009 12:10 PM
Finding the top CPU-using processes? "top" command does not help... catalytical Linux - Server 1 04-06-2009 04:50 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 10:27 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