Operating System - HP-UX
1846974 Members
5138 Online
110257 Solutions
New Discussion

process and memory question

 
SOLVED
Go to solution
bhupesh m
Frequent Advisor

process and memory question

Hi,
simple question.
i would like to know which process consumes how much memory.
if i dont have glance what should i do?
with glance what is the exact command?
thanks,
5 REPLIES 5
Coolmar
Esteemed Contributor
Solution

Re: process and memory question

Hi,

Check out this thread, I think it may contain what you require.

S.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=111838
Peter Godron
Honored Contributor

Re: process and memory question

Jaime Bolanos Rojas.
Honored Contributor

Re: process and memory question

bhupesh,

If you do not have glance, the top command is the the easiest one of all of them.

Regards,

Jaime.
Work hard when the need comes out.
Geoff Wild
Honored Contributor

Re: process and memory question

# cat /usr/local/bin/processmem

#!/bin/sh
# processmem - display memory claimed by a process
#
if [ $# -lt 1 -o \( $# -gt 1 -a $# -lt 4 \) ]
then
echo "Usage:"
echo "processmem \"process\""
echo "Example:"
echo "processmem rpc"
exit 1
fi
echo " "

PROCESS=$1

mps=0
#for sz in `ps -elf | grep $PROCESS | grep -v grep | awk '{print $10}'`
for sz in `UNIX95= ps -e -o vsz=Kbytes -o ruser -o pid,args=Command-Line | sort -rnk1 | grep -v Kbytes | grep $PROCESS | awk '{print $1}'`
do
mps=`expr $mps + $sz`
done
#echo `expr $mps \* 4096`
echo "\nMemory claimed by $PROCESS: $mps Kbytes.\n"



Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
bhupesh m
Frequent Advisor

Re: process and memory question

thanks admins.
i will go thru those pages and reply if i found some doubts..
thanks again,..