LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How much memory is application XYZ using? (https://www.linuxquestions.org/questions/linux-general-1/how-much-memory-is-application-xyz-using-498063/)

BrianK 11-02-2006 06:38 PM

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).

pljvaldez 11-02-2006 07:07 PM

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

http://wiki.marandcustomsolutions.co...g+memory+usage

BrianK 11-02-2006 07:14 PM

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!

timmeke 11-03-2006 08:30 AM

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.


All times are GMT -5. The time now is 06:11 PM.