LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 11-02-2006, 06:38 PM   #1
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
How much memory is application XYZ using?


I want to track how much memory a certain app is using & log it along with some other things I log every minute as a cron job. Is there some command that will spit back some info on memory usage of an application by name or PID? It has to be non-interactive because I'm going to do it with a script - so top won't work (at least as far as I know).
 
Old 11-02-2006, 07:07 PM   #2
pljvaldez
Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092

Rep: Reputation: 269Reputation: 269Reputation: 269
Depending on how accurate of usage you need, ps and awk might be enough.

http://wiki.marandcustomsolutions.co...g+memory+usage
 
Old 11-02-2006, 07:14 PM   #3
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Original Poster
Rep: Reputation: 51
Quote:
Originally Posted by pljvaldez
Depending on how accurate of usage you need, ps and awk might be enough.

http://wiki.marandcustomsolutions.co...g+memory+usage
That looks like it'll do. Thanks!

For others that come across this thread, I'm using:

ps -eo rss,args | grep "XYZ" | grep -v "grep"

Thanks!
 
Old 11-03-2006, 08:30 AM   #4
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Quote:
non-interactive because I'm going to do it with a script - so top won't work (at least as far as I know).
On my box, "top -n1" doesn't refresh it's output, so it's suitable for scripting.

The ps solution posted above is probably easier, though.
 
  


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
service xyz start instead of /etc/init.d/xyz start stefaandk Fedora 3 08-01-2006 08:00 PM
Limit max thread and memory for application in linux kernel 2.4.x manhvt Linux - General 4 07-12-2005 03:41 PM
Application / memory management cyberfunk Linux - General 2 03-17-2004 04:14 PM
Trouble of Installing new package, application and memory in RH9 lhksys Linux - Software 0 11-26-2003 01:30 AM
memory allocation, application<-->driver charlies Programming 2 03-03-2001 11:26 PM


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