- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: memory utilization
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2004 11:39 PM
03-24-2004 11:39 PM
TOP is not giving full memory utilization information.( I mean full physical memory).
Can anybody help with some commands or scripts?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2004 11:46 PM
03-24-2004 11:46 PM
Re: memory utilization
can give you some info on physical memory usage ..
-Karthik S S
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2004 11:47 PM
03-24-2004 11:47 PM
Re: memory utilization
You can activate sar, it will record system activity on file that you can interrogate later on.
vmstat is also a very good tool but do not record anything unless you redirect it's output.
This script is for Solaris so adapt it to your need :
#!/bin/ksh
DELAY=${1:-20}
# Redirect output LOG=/projets/RST/rstexplo/outils/cperf_`date +'%y_%m_%d__%H_%M'`.log
#exec 1>>$LOG 2>&1
id ; echo "${0##*/} lunched `date +'%A %d %B %Y %H:%M:%S'` on tty `tty`"
tput bold
print "Time %usr %sys %wio %idl intr migr smtx syscl r b w Swap RAM re mf pi po fr de sr in sy cs kr/s kw/s wsvc_t"
tput rmso
# The real thing
while :
do
{
date +'%H:%M:%S'
/usr/bin/sar -u 1 2 | nawk '{ if ( $1 ~ /Average/ ) { print $2" "$3" "$4" "$5 } }'
/usr/bin/mpstat 1 3 | /bin/grep -v '^CPU' | tail -16 | \
/usr/bin/nawk '{ intr += $5 ; migr += $9 ; smtx += $10 ; syscall += $12 } END { printf("%5.f %5.f %5.f %5.f\n",intr/2, migr/2,smtx/2,syscall/2) }'
/usr/bin/vmstat 2 2 | tail -1
/usr/bin/iostat -nx 2 2 | /usr/bin/nawk 'BEGIN { shw=0 } { if ( $1 ~ /extended/ ) { shw++ } if ( shw > 1 ) \
{ if ( $11 ~ /c..*t..*d/ ) { kb +=$3 ; kw += $4 ; wsvc_t += $7 } } }
END { printf("%d %d %3.1f \n", kb, kw, wsvc_t) }'
} | /usr/bin/xargs | \
/usr/bin/nawk '{ printf("%8s %4d %4d %4d %4d %5d %5d %5d %6d %2d %2d %2d %5d %5d %5d %5d %7d %5d %3d %3d %3d %5d %5d %5d %6d %6d %3.1f\n",
$1, $2,$3,$4,$5, $6,$7,$8,$9, $10,$11,$12, int($13/1024),int($14/1024), $15,$16,$17,$18,$19,$20,$21, $26,$27,$28, $32,$33,$34 ) }'
# Time %u %s %w %id in mg sm scl r b w Swap RAM re mf pi po fr de sr in sy cs r/s w/s svc_t"
sleep $DELAY
done
exit 0
/usr/bin/mpstat 1 3 | grep -v '^CPU' | tail -16 | awk '{ migr += $9 , smtx += $10 } END { printf("%4.f\n",smtx/16) }'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2004 11:48 PM
03-24-2004 11:48 PM
Re: memory utilization
From
http://www.cmve.net/~merijn/
How much memory do I have
a5:/ 112 # echo "selclass qualifier memory;info;wait;infolog" | cstm | grep 'Total Configured'
Total Configured Memory : 2048 MB
a5:/ 113 # echo 'memory_installed_in_machine/D' | adb -k /stand/vmunix /dev/mem | perl -nle'/(\d+)/&&print$1*4,"k"'
2097152k
a5:/ 114 # grep Physical /var/adm/syslog/syslog.log
Aug 25 08:01:07 a5 vmunix: Physical: 2097152 Kbytes, lockable: 1562360 Kbytes, available: 1801856 Kbytes
a5:/ 115 #
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2004 11:51 PM
03-24-2004 11:51 PM
Re: memory utilization
Unfortunately it doesn't give you much in the way of stats about virtual memory. Paging-in and out rates, and swapping-in and out rates are shown. Its not very useful in helping to sort out bottlenecks in memory, but it *might* be enough to give you an idea.
vmstat will allow you to monitor virtual memory, but not on a per-process basis. Again, might be enough to give you a clue.
Last thing is to download a trial version of glance - it will last long enough to look at your current problem, and maybe even persuade your bosses that glance is a good investment??
Col
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2004 04:01 AM
03-25-2004 04:01 AM
Solution# cat top10
#/bin/sh
UNIX95= ps -e -o "vsz pcpu ruser pid stime time state args" | sort -rn |head -10
# cat usermem
#!/bin/ksh
# usermem - display memory claimed by a user
# gwild 06232003
#
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"
# cat processmem
#!/bin/sh
# processmem - display memory claimed by a process
# gwild 03192004
#
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"
As well as attached c program called memdetail
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2004 05:30 AM
03-25-2004 05:30 AM
Re: memory utilization
Introduction to Performance Tuning
DocId: UPERFKBAN00000726
it will walk you through pretty much any issue you might have. No special tools needed all of them are listed with a description of what to look for.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2004 05:57 AM
03-25-2004 05:57 AM
Re: memory utilization
Total memory you have
# echo "phys_mem_pages/D" | adb -k /stand/vmunix /dev/kmem
Multiply the output with 4 and the resulting number is the amount of memory you have in Kbytes.
Free Memory
# echo "freemem/D" | adb -k /stand/vmunix /dev/kmem
Multiply the output with 4 and the resulting number is the amount of FREE memory you have in Kbytes.
Search for shminfo, kmeminfo and procsize - 3 unsupported tools that will give u wealth of information.
Sundar