1748148 Members
3558 Online
108758 Solutions
New Discussion юеВ

Re: memory usage

 
Tonatiuh
Super Advisor

memory usage

HP-UX 11.23 and Oracle 9.2.0.5

How to know the total amount of memory used by each dedicated user session?
6 REPLIES 6
Slawomir Gora
Honored Contributor

Re: memory usage

Hi,

ps -flu oracle
top

if you have Enterprise OE -> glance
Simon Hargrave
Honored Contributor

Re: memory usage

Assuming you don't have Glance et al, you can use the following PS construct to view the size of each process on the system: -

UNIX95= ps -e -o vsz=Kbytes -o ruser -o pid,args=Command-Line | sort -rnk1 | grep -v Kbytes

then just process the output to add up memory for each user.

This is now wholly accurate though, because the VSZ (virtual set size) includes any shared memory for each process listed. It will however give an indication in the abscence of Glance.
Jean-Luc Oudart
Honored Contributor

Re: memory usage

Not a simple question !

Memory allocation can change during the life of a process depending on dynamic requests,...

One way of measuring the memory and reserved (that is important too) is to check memory usage and reserved usage while counting users on the server.
This can be done with Glance.
Of course, this will not take account of other user / group application on same server if any and this method is just a rough guide.

You can use Glance to check individual Memory requirement (application/oracle process ,dedicated server)

Also, check Metalink note id 148466.1 & 166490.1

If you don't have Glance you can download a tril version for limited period of time.

Regards,
Jean-Luc
fiat lux
Geoff Wild
Honored Contributor

Re: memory usage

Try this script:

# 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"


Or for user:

#!/bin/ksh
# usermem - display memory claimed by a user
#
if [ $# -lt 1 -o \( $# -gt 1 -a $# -lt 4 \) ]
then
echo "Usage:"
echo "usermem \"userid\""
echo "Example:"
echo "usermem gwild"
exit 1
fi
echo " "

USER=$1
t=0
for j in `UNIX95= ps -e -o vsz=Kbytes -o ruser -o pid,args=Command-Line | sort -rnk1 | grep -v Kbytes | grep $USER | awk '{print $1}'`
do
t=`expr $t + $j`
done
echo "\nMemory claimed by $USER: $t 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.
Ted Buis
Honored Contributor

Re: memory usage

The fact that you are asking the question seems to indicate that you are concerned about memory pressure. First, I would suggest making sure that the maximum dynamic buffer cache percentage of memory isn't set too high. You don't need more than 1 GB for buffer cache and most likely not more that .5GB. Second, OnlineJFS is useful so that you can avoid Oracle using the HP-UX buffers and essentially buffering the data twice, which is a total waste of time and memory. See the attached "Cookbook" for details. Third, check for page outs, which would clearly indicate a need for more RAM if everything else has been done.
Mom 6
Hein van den Heuvel
Honored Contributor

Re: memory usage


As of Oracle 9i you can take an alternate approach. You can drop explicit per-process settings like sort_area in favor or 'pga_aggregate_target'. This will tell Oracle the target for the total local memory for all user processes in an instance.

Are you just curious or trying to solve a problem? If you are trying to solve a problem, then give us at least high level break down of memory: physical, sga (for each instance), dbc, number-of-connections,...

Regards,
Hein.