LinuxQuestions.org
Review your favorite Linux distribution.
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-04-2008, 03:27 PM   #1
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 316

Rep: Reputation: 30
Check process mem usage?


Let's say a server has a limit of 25MB RAM on each user. How can I check the amount of RAM my process uses? I assume I would use ps, but there are so many fields there. There is also a limit of 10% CPU Usage. How would I check that? I would assume it's the CPU% field in ps, but I just want to double check.
 
Old 03-04-2008, 05:17 PM   #2
hasanatizaz
Member
 
Registered: Nov 2007
Location: Pakistan
Distribution: Redhat and Debian
Posts: 302
Blog Entries: 1

Rep: Reputation: 34
maybe vmstat ?
 
Old 03-04-2008, 06:51 PM   #3
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 316

Original Poster
Rep: Reputation: 30
Okay I tried that, but it doesn't seem to indicate the process using the memory.
 
Old 03-06-2008, 10:32 PM   #4
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 316

Original Poster
Rep: Reputation: 30
Anyone? It would be great to give an example of how to use the command to find it, too. If vmstat does do it, I don't know how.
 
Old 03-06-2008, 10:36 PM   #5
sundialsvcs
Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 5,354

Rep: Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105Reputation: 1105
One thing to bear in mind is... Linux is "lazy." If there is no "pressure" being exerted on the memory subsystem at this particular moment, then Linux is not going to go out of its way to "clean house." If, and (only...) when actual pressure starts to develop, Linux will start snooping-around for things to get rid of or to "steal."

So, absent any sources of "pressure," the memory-allotment for any particular process might well appear to be much larger than such a process might be if actual pressure existed.
 
Old 03-09-2008, 05:31 PM   #6
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 316

Original Poster
Rep: Reputation: 30
Well I need to ensure my process(es) are not nearing the limit. That is all I'm looking to do.
 
Old 03-09-2008, 05:38 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,974
Blog Entries: 11

Rep: Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879Reputation: 879
Look at top ... it gives you the usage detail you're after.


Cheers,
Tink
 
Old 03-17-2008, 04:01 PM   #8
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 316

Original Poster
Rep: Reputation: 30
So for example if I wanted to check the process RAM, would I be looking at "RES" in top?
 
Old 03-17-2008, 04:53 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,226

Rep: Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019
Yes.
Well ... yes-ish. Maybe.
Close enough for most purposes. The problem is how to account for shared libraries.

Else have a look at /proc/<pid>/smaps.
Last I looked, this was pretty comprehensive but poorly documented.
 
  


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
How to check memory usage on running process/applications rickylim Linux - General 17 05-08-2013 09:09 PM
Lowering Mem usage DropHit Red Hat 2 12-20-2003 10:36 PM
XWindosw - 1G (and more) mem usage!! drand Linux - General 2 12-02-2003 12:28 PM
High Mem Usage miketheninja Linux - General 2 11-05-2003 04:26 PM
post your mem usage... zeky Linux - General 36 12-10-2002 12:41 AM


All times are GMT -5. The time now is 05:26 AM.

Main Menu
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