SUMMARY: Total User Memory Footprint

From: Romeo Theriault <romeotheriault_at_gmail.com>
Date: Wed May 28 2008 - 11:31:14 EDT
Many Thanks for all the responses (folks listed below):

Most people replied with some combination of using prstat -a and prstat -t
or using ps with a command like this: 'ps -eo vsz,rss,user' and adding up
the vsz and rss per user. francisco roque gave a handy little shell script
to do this:

ps -eo user= | sort -u | while read U; do ps -eo vsz,rss,user |
awk '/'$U'/{ v+=$1; r+=$2} END {print "user '$U' is using VSZ of", v, " and
RSS of", r}'; done

Many people also noted that using the ps and prstat methods will not be all
that accurate for processes that use lots of shared memory, such as oracle.
Suggestions for getting more accurate answers included using the ipcs and
pmap commands.

Since I can't explain it better, here is a quote from Darren Dunham
explaining how one would get more accurate results with pmap.

"So the smart (and more difficult) thing to do is run 'pmap -x <PID>' for
all processes that you're interested in.  Then check the shared mappings
to files and ISM and count those only once for all the files they appear
in.  Then count anonymous and other private spaces for each file it's
in.  That should get you a much closer count."

So, thanks again for all the responses from people. In this case I believe
that the prstat -t output will be close enough of an approximation for our
needs.

Thanks to:
Richard Skelton
xyu121520
Aleks Feltin
Darren Dunham
Francisco Puente
Dean Ross-Smith
John Hallman
Steve Edberg
Francisco Roque
--
Romeo Theriault
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Wed May 28 11:32:27 2008

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:44:11 EST