LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-07-2014, 02:05 AM   #1
akonchada
LQ Newbie
 
Registered: Sep 2010
Posts: 21

Rep: Reputation: 1
General question on memory shown in top


I have one question in general on TOP memory,

with top when i get the bellow data (at system level) , how should i read 'Used' memory (Mem: 49371432k total, 917120k used, 48454312k free, 24256k buffers). Will it consider all Unix processes consumption (RES/VIRT/SHM), if yes which memory will it consider? Once process stopped, will this count come down?

Or it is just memory considering whole system physical memory used by all active processes? including kernal persistent memory (like Shared memory created by application, kernal persistent Qs etc..) Or anything else considered here.

Also how to read the relation in data shown in "MEM:" and "SWAP:" lines of top out put.


Thanks In Advance
Anan
 
Old 05-07-2014, 02:23 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by akonchada View Post
I have one question in general on TOP memory,
Really. In that case, which one would you like answered ?.
 
Old 05-07-2014, 02:33 AM   #3
akonchada
LQ Newbie
 
Registered: Sep 2010
Posts: 21

Original Poster
Rep: Reputation: 1
My understanding with 'Used' is, kernal shows whole physical memory in use (including kernal persistent memory allocated by application S/W)
My doubt is is this is some thing more than what i understood/assumed then what it is?
 
Old 05-07-2014, 07:10 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
It is almost impossible to determine what memory is actually being used. We take what we are given.
The numbers in the header for top are taken from /proc/meminfo - this is what the kernel tells us, so is considered definitive. But without wading through the source code, you'll never know.
The used number is everything allocated - usually more in fact as Linux doesn't immediately move pages from the allocated to free queue when a process ends. The memory still shows as allocated even though it is free-able. If there is demand, kswapd will run through the queues reassigning pages as needed. But this is an asynchronous action.

Like I said, almost impossible to get a (correct) specific number.
 
Old 05-09-2014, 12:26 AM   #5
akonchada
LQ Newbie
 
Registered: Sep 2010
Posts: 21

Original Poster
Rep: Reputation: 1
Thanks for assisting.
 
  


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
programatically read 'size' shown in top on SunOS? douglaskbell Solaris / OpenSolaris 3 02-20-2010 06:05 AM
[SOLVED] top: select the shown fields from the command-line TITiAN Linux - Software 2 02-08-2010 05:27 PM
Questions about memory usage general definitions on 'top' [ITA]freeware Linux - Software 8 10-28-2009 03:24 PM
top command - Time shown sameer29 Linux - Newbie 3 06-12-2008 02:59 PM
4 CPU's shown in top and /proc/cpuinfo Kristijan Linux - General 6 01-25-2005 08:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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