1854686 Members
47443 Online
104102 Solutions
New Discussion

Memory being used

 
Mike_21
Frequent Advisor

Memory being used

Is there a simple script someone has that will determine the amount of memory being used by a specific application? For example, the amount of memory used by a web server, and/or the amount being used by Informix?

Thanks
5 REPLIES 5
Tony Constantine_2
New Member

Re: Memory being used

Hi

Try this command, all on the same line

UNIX95= ps -e -o vsz=Kbytes -o ruser -o pid,args=Command-Line | sort -rnk1 | more
harry d brown jr
Honored Contributor

Re: Memory being used

The best tool for that is glance/measureware and perfview.

live free or die
harry
Live Free or Die
Tim Ryan
Advisor

Re: Memory being used

I wrote a script to capture memory usage for specific processes (or groups of processes) and provide trending results to a file. You may need to modify the variables at the top of the script, but otherwise it's pretty straight forward. You'll need to create a index file in the following format:

#CATEGORY_NAME Individual process....
NETSCAPE netscape helper
DISPLAY hide
FONTSERVER /usr/openwin/bin/fs
CALCULATOR calctool
OPENWINDOWS olwm
PRINTING /etc/lp lpsched /usr/spool/lp hpnp /var/spool/lp


Good luck!
-Tim
Deshpande Prashant
Honored Contributor

Re: Memory being used

HI
You may use the glance and measureware.
Configure the parm file for applications/processes you need to monitor.

Thanks.
Prashant.
Take it as it comes.
Krishna Prasad
Trusted Contributor

Re: Memory being used

I think you will need to use both ps -efl and ipcs -mb to get the total result. I don not think the ps -efl command checks for shared memory segements.

If you know your app doesn't use any shared memory.

Try ps -efl| grep "user id" | awk ' { sum += $10 } END { printf "Using Pysical Pages = %ld\n", sum } '

This will give the number of physical pages of the core image of the process. The next thing you need to know is what your page size is set at. It is usally 4K you can verify this by typing get_conf PAGE_SIZE. Once you know this you can modify the script above to * 4K to sum and this will give the size in K. You then can divide by 1024 to get MB that number by 1024 to GB and so on.

Hope this helps. but don't forget the shared memory.
Positive Results requires Positive Thinking