LinuxQuestions.org
Help answer threads with 0 replies.
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-02-2011, 12:49 PM   #1
vintage2010
Member
 
Registered: Nov 2010
Location: Ohio
Distribution: RHEL 5
Posts: 52

Rep: Reputation: 0
running the TOP command


When running the top command I'm able to see the {%} of Memory being as well as others used by the system. At the very top it lists out how much memory I have total, being used, how much is free and finally the buffers.

I want to figure out why the {%} of memeory being used does not equal the KB it's displaying.

Is there a command I can run that will display what the Process Memory Usage is?

I tried the pmap -d PID and it returned a usage list.
 
Old 03-02-2011, 01:09 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,948

Rep: Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210
There are lots of threads here (and elsewhere) about this. Linux uses shared libraries - they are only loaded (in memory) once, but generally counted for every user (process).
For the pmap, you need to supply the numeric pid of interest, not the literal string PID.
 
Old 03-02-2011, 02:38 PM   #3
vintage2010
Member
 
Registered: Nov 2010
Location: Ohio
Distribution: RHEL 5
Posts: 52

Original Poster
Rep: Reputation: 0
Ok -- my bad -- I should have check the Similiar threads -- I found some useful information.

SO after chatting with the user what I really want to see is the %MEM in a different form other then the percentage.
I would like to see a number in KB, MG etc... Is that possible?
 
Old 03-02-2011, 02:48 PM   #4
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
Check the RES field (the non-swapped physical memory a task has used).
 
Old 03-02-2011, 03:55 PM   #5
vintage2010
Member
 
Registered: Nov 2010
Location: Ohio
Distribution: RHEL 5
Posts: 52

Original Poster
Rep: Reputation: 0
SO - the RES field is the actual (KB, MB etc) getting used by that particular PID. The %MEM just converts what the RES is?

How can I determine how much RAM is being used by one PID?

FOR EXAMPLE: “255592k total” is total memory in the system; “167568K used” is the part of the RAM that currently contains information; “88024k free” is the part of RAM that contains no information; “25068K buffers and 85724k cached” is the buffered and cached data for IO.

used - (buffers + cached) = X but that's for all programs. How can I determine it for one...
 
Old 03-03-2011, 12:46 AM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,948

Rep: Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210
Nope. Memory usage is a can of worms. Go get ps_mem.py and run that - if you want some good background look at the (python) code; even just the comments.
 
Old 03-03-2011, 10:55 AM   #7
vintage2010
Member
 
Registered: Nov 2010
Location: Ohio
Distribution: RHEL 5
Posts: 52

Original Poster
Rep: Reputation: 0
Yes it is

Thanks foe all the help syg00 and colucix !!

I'll mark as solved.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Can You Top This? 15 Practical Linux Top Command Examples LXer Syndicated Linux News 0 01-09-2010 10:42 PM
Finding the top CPU-using processes? "top" command does not help... catalytical Linux - Server 1 04-06-2009 05:50 PM
Top Command swamprat Linux - Software 3 09-23-2007 03:08 AM
running top shows 2 users gibson79 Slackware 8 03-08-2007 10:19 AM
TOP: says kdeinit is running 7 times, WHY ? qwijibow Linux - Software 1 12-01-2003 05:50 AM

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

All times are GMT -5. The time now is 10:09 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration