1758669 Members
1929 Online
108874 Solutions
New Discussion юеВ

Re: HP-UX and ps command

 
Savio Pereira
Occasional Contributor

HP-UX and ps command

HP Gurus,

For any process using/attaching to shared libraries the ps -elf wil report the process memory inlcuding the actual process memory and the memory used by the shared libraries. Is there any way or any option of ps which will report only the actual process memory.

Regards
Savio
Savio_Informix
4 REPLIES 4
Tom Geudens
Honored Contributor

Re: HP-UX and ps command

Hi,
Are these the commands you are looking for ?
UNIX95= ps -e -o vsz,ruser,args
UNIX95= ps -e -o sz,ruser,args

Execute them exactly as I put them in here.
Hope this helps,
Tom
A life ? Cool ! Where can I download one of those from ?
T G Manikandan
Honored Contributor

Re: HP-UX and ps command

#UNIX95 =ps -e -o ruser,pid,vsz=Kbytes|more

should give you that

Thanks
G Manikandan
Michael Tully
Honored Contributor

Re: HP-UX and ps command

Hi,

Save and sort it as well.

# UNIX95= ps -e -o "ruser,vsz,args" | sort -rnk2 >/tmp/wrk

Cheers
~Michael~
Anyone for a Mutiny ?
Steve Steel
Honored Contributor

Re: HP-UX and ps command

Hi

Again
#!/usr/bin/ksh
#
# Show processes sorted by size of core image
#
# Usage:
# psram [ quantity ]
#
# where quantity is the top RAM processes to show (default is 20)
#
set -u
if [ $# -gt 0 ]
then
TOPPROCS=$1
else
TOPPROCS=20
fi

MYNAME=$(basename $0)
TEMPFILE=/var/tmp/$MYNAME.$$
trap `rm -f $TEMPFILE > /dev/null 2>&1` 0 1 2 3 15

UNIX95= ps -e -o ruser,vsz,pid,args > $TEMPFILE
head -1 $TEMPFILE
DASH5="-----"
DASH25="$DASH5$DASH5$DASH5$DASH5$DASH5"
echo "$DASH5---- $DASH5- $DASH5 $DASH25$DASH25"
grep -v "VSZ COMMAND" $TEMPFILE | cut -c -78 | sort -rn -k2 | head -${TOPPROCS}
rm $TEMPFILE > /dev/null 2>&1


CPU

UNIX95= ps -e -o pcpu -o ruser -o vsz -opid -o args|head -n1
UNIX95= ps -e -o pcpu -o ruser -o vsz -opid -o args|grep -v %CPU| sort -nr|tail -n +2|head -n 20


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)