Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

memory

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi

how to find out how much memory each appliation is taking on solaris box

reg
 
I have some restrictions on dowloading the TOP utility in my environment. Is there any other way we can find the memory for each application.

 
Cut and paste the following into a script:
========Start cut below====================
#!/bin/sh
############################################################
PS=/bin/ps
CUT=/usr/bin/cut
SORT=/usr/bin/sort
HEAD=/usr/bin/head

if [ -x $PS -a -x $CUT -a -x $SORT -a -x $HEAD ]
then
echo
echo " %CPU PID TIME VSZ USER COMMAND"
echo
$PS -aef -o pcpu= -o pid= -o time= -o vsz= -o user= -o args= |
$CUT -c -130 | $SORT -r | $HEAD -10
else
exit 1
fi
======================End cut above===================

Can't claim the credit for this as it's someone else's (sorry I forget who exactly), but it seems to work OK. HTH.
 
Thanks for the script Mr Ken.

I got the output but how do i calculate the memory from the output ? Pls explain in detail. Sorry to bother u.

reg
 
Hi

I found VSZ for one application is 14488 and my pagesize is 8192. Does it mean that the memory taken by that applicaton is 14488*8192 = 118685696

pls explain
 
Hi

I found VSZ for one application is 14488 and my pagesize is 8192. Does it mean that the memory taken by that applicaton is 14488*8192 = 118685696 = 118MB

pls explain
 
The first column (%CPU) gives you the percentage CPU the particular process is using, and will hopefully give you some idea of how memory-hungry your applications are. Cheers.
 
i got it..

VSZ - The total size of the process in virtual memory, in kilobytes.

thx KEN
 
Ken

Right now if the application is in the sleep mode we are unable to find the VSZ using that script. I need to stop and start that application then i am able to know the memory usage. Is it possible to find the memory using the PID.

First i can do ps -edf | grep <app>

then with that pid i want to know how much memory it is taking in sleep mode....

Pls do the needful
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top