Hi,
I am a newbie and would like help to determine the total memory usage by a user eg oracle in Solaris 10 machine.
The user has been assigned a total memory of 20gb .But there are a number of processes under that user.
I would like to know the total memory being utilized from all the processes under oracle at a given time ,out of the total 20gb memory assigned
Thanks
You could also have a look at the output for:-
ps -lu username
Look at the SZ column.
Robin
Below a nagios plugin:
#!/bin/sh
#
# Warn if a user consumes too much memory (RSS)
# ARG 1: limit (MB)
#
set -f
export PATH
PATH=/bin:/usr/bin:/usr/sbin:/sbin
limit=${1:-5700}
check=`ps -e -o uid= -o rss= | awk '
BEGIN {limit='$limit'*1024}
{m[$1]+=$2}
END {for (i in m) if (m>max) {max=m; uid=i} if (max>limit) print "uid="uid,"max="int(max/1024)}
'`
if [ -z "$check" ]
then
echo "OK: all users below $limit MB resident memory"
exit 0
else
eval $check
user=`getent passwd $uid | cut -f1 -d:`
echo "WARNING: user $user ($uid) uses $max MB resident memory"
exit 1
fi
Hi,
Correct me if I am wrong the SZ column indicates the swap space and not the shared memory utilization by the user .Thanks in advance
---------- Post updated at 08:26 AM ---------- Previous update was at 08:26 AM ----------
$ man ps
...
sz SZ size in physical pages of the core image of the
process. This includes text, data, and stack
space. Device mappings are currently excluded;
this is subject to change. See vsz and rss.
...
Hi
Man ps gives
and I tried doing ps -lu <user> -o user,rss
Please correct me that a sum total of rss will give me the total memory instead of SZ.
Thanks
It's not that simple. Oracle in particular uses lots and lots of shared memory. A good amount for each process is likely to be the same memory, shared between all of them -- just making a blind total will greatly inflate it. I've heard people suggest querying Oracle itself about how much memory its using, though I'm not too clear on how.
VSZ shows claimed/reserved/overcommitted memory.
RSS shows resident/initialized memory.
Usually RSS and pmem are more relevant. Check yourself.
ps -u myuser -o pid,vsz,rss,pmem,args
Follow the automatic content links below! Search this forum for RSS and VSZ!
For a quick summary, and comparison with your ps results try
prstat -t