1847207 Members
3368 Online
110263 Solutions
New Discussion

Memory usage!!!

 
Markswell
Contributor

Memory usage!!!

Hi everyone!!!

I need to buid one shell script that report de RSS memory usage, what command i can use to collect this information.

Thank's in advance
Markswell
6 REPLIES 6
Bill Hassell
Honored Contributor

Re: Memory usage!!!

Use this command to sort everything:

UNIX95= ps -e -o vsz,pid,args | sort -rn

This will show the largest memory users at the top of the list. Note that shared memory cannot be logically assigned to any specific process as it is shared. ipcs -bmop will show shared memory usdage.


Bill Hassell, sysadmin
Steven E. Protter
Exalted Contributor

Re: Memory usage!!!

I have a general script for performance data collection. I believe the memory portion might give you at least a starting point.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
KapilRaj
Honored Contributor

Re: Memory usage!!!

Bill,

VSZ is displayed in which unit (KB,MB) by the way. I am sorry i can not assign points to you on this thread as it belongs to somebody else.

Kaps
Nothing is impossible
Elmar P. Kolkman
Honored Contributor

Re: Memory usage!!!

man ps -> vsz The size in kilobytes (1024 byte units) of the core image of the process. ...

Every problem has at least one solution. Only some solutions are harder to find.
Bill Hassell
Honored Contributor

Re: Memory usage!!!

As mentioned, VSZ is Kbytes. This is one of the more useful metrics in ps but requires the temporary setting of UNIX95 to make it work. The man page for ps has this info. I've attached a really useful script called viman--allows you to browse man pages with vi which is a lot faster that using more or pg.


Bill Hassell, sysadmin
Bill Hassell
Honored Contributor

Re: Memory usage!!!

Sorry, attachment here...


Bill Hassell, sysadmin