LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-29-2011, 03:25 PM   #1
m4rtin
Member
 
Registered: Sep 2007
Posts: 261

Rep: Reputation: 16
understanding the output of "free"


I have a small server with following memory usage:
Code:
root@debian:~# free -m
             total       used       free     shared    buffers     cached
Mem:          2003       1822        181          0         42        939
-/+ buffers/cache:        840       1163
Swap:         2379          0       2379
root@debian:~#
I have 2048MB of RAM in server. As I understand, 2003MB is the amount of memory what is left of this 2048MB after kernel reserved 45MB during the bootup. The third line regarding swap is clear as well(results overlap with swapon -s). In addition, if I'm not wrong, only 181MB of RAM is totally unused.

I'm aware of that Linux uses free memory for buffers, but how to find out how much memory is in use for applications? Is it 2003MB-181MB-840MB= 982MB?
 
Old 06-29-2011, 03:28 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,297

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
The docs do say that free is less than perfect. Try top, or as you have a server, get some more serious profiling tools. BTW I've just posted a query about it on the mobile forum.
 
Old 06-29-2011, 05:51 PM   #3
m4rtin
Member
 
Registered: Sep 2007
Posts: 261

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by business_kid View Post
The docs do say that free is less than perfect. Try top, or as you have a server, get some more serious profiling tools. BTW I've just posted a query about it on the mobile forum.
Could you name some serious profiling tools for Linux server in order to analyze memory usage?
 
Old 06-29-2011, 10:56 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,128

Rep: Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121Reputation: 4121
Quote:
Originally Posted by m4rtin View Post
I'm aware of that Linux uses free memory for buffers, but how to find out how much memory is in use for applications? Is it 2003MB-181MB-840MB= 982MB?
Nope - you could simply look at the free output
Code:
-/+ buffers/cache:        840       1163
All the maths has been done for you.

Of course that presupposes all the buffer/cache is not relevant to any app. Couldn't be more wrong, but a lot of people seem happy with that number.
Linux memory usage is a real can of worms - /proc/<pid>/smaps was added a while back to expose more of the data. Have a read of this - it includes a perl script as well.

Last edited by syg00; 06-29-2011 at 10:59 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
Output from "free" command: Difference between buffer and cache kenneho Linux - Kernel 2 09-05-2012 09:35 AM
square brackets in output of "ps aux" not matching output of "ps -ejH" alirezan1 Linux - Newbie 14 07-14-2010 04:17 AM
Understanding output from "last" TronCarter Linux - Software 1 01-19-2010 02:50 PM
"failed to execute child process" "Input/output error" fl.bratu Fedora 4 12-15-2008 04:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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