LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 05-31-2007, 12:46 PM   #1
MasterOfTheWind
Member
 
Registered: Jul 2004
Distribution: Arch, Debian sid, Kubuntu, Slackware 11
Posts: 324

Rep: Reputation: 30
Why is memory load hard to measure?


Hi!

I keep hearing that different programs (like free, top, exmap etc.) give a different output of how much RAM is used for which purpose.

Why is it so hard to measure used memory?

Thanks in advance
 
Old 05-31-2007, 02:32 PM   #2
pljvaldez
Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092

Rep: Reputation: 269Reputation: 269Reputation: 269
Mostly because linux shares libraries across many programs. So it's tough to know exactly how much memory is used by a single app. free -lm is close enough for me (look at the line "-/+ buffers/cache" -- the free column is how much memory is free for applications to use).
 
Old 05-31-2007, 02:41 PM   #3
MasterOfTheWind
Member
 
Registered: Jul 2004
Distribution: Arch, Debian sid, Kubuntu, Slackware 11
Posts: 324

Original Poster
Rep: Reputation: 30
Oh, OK. Thank you very much for the answer
 
Old 06-01-2007, 06:12 AM   #4
MasterOfTheWind
Member
 
Registered: Jul 2004
Distribution: Arch, Debian sid, Kubuntu, Slackware 11
Posts: 324

Original Poster
Rep: Reputation: 30
Though what I still do not understand, is why some prefer for example ExMap instead of free. I mean, if it is impossible to know for certain how much of memory a certain process uses, *can* there at all be any difference between how you try to measure it?
 
Old 06-01-2007, 06:27 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,491

Rep: Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077Reputation: 1077
Debate has been long and volumious - even amongst the kernel devs.
What does "used memory" mean (to you) ???.

I don't necessarily agree with the way exmap accounts the (shared) pages, but it was a good attempt with the data available at the time.
/proc/<pid>/smaps is the latest iteration of attempts to account for the memory allocation.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to _accurately_ measure memory usage? rhimbo Linux - Kernel 10 02-21-2007 11:00 PM
How to measure a program's peak memory consumption? hae Linux - Software 2 06-23-2005 09:39 AM
could not load program into memory on HD install jordan0 Mandriva 5 04-08-2004 03:49 PM
measure memory usage unosoft Linux - Software 1 10-07-2003 07:25 PM
CPU, Load and Memory ... KnightAzul Linux - General 1 09-17-2003 12:57 PM


All times are GMT -5. The time now is 07:46 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration