Unix Shell - How to measure memory usage?

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > January 2006 > How to measure memory usage?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How to measure memory usage?
kj

2006-01-22, 6:10 pm





What's the best way to determine the most memory a program uses
during its execution?

Thanks!

kj

--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
krsyoung

2006-01-22, 6:10 pm

Depending on how accurate of data you need, usually top or ps will do
the trick. If you want more data than just eye balling top, run ps in
a shell script to have it poll the process every couple of
seconds/minutes too see how much memory it is using. With a command of
ps -o vsz,rss <pid> you can get a good idea of these values.

Also, if you wanted in another shell you could run watch -n 5 "ps -o
vsz,rss <pid>" which will run the command every 5 seconds.

Hope this helps!
Chris

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com