1832978 Members
2696 Online
110048 Solutions
New Discussion

commands

 
Frances Prindle
Occasional Advisor

commands

What is the best command to determine physical memory of a system?
It is not a problem, but a learning experience.
6 REPLIES 6
James R. Ferguson
Acclaimed Contributor

Re: commands

Hi:

# top
# dmesg
# glance
# grep -i physical /var/adm/syslog/OLDsyslog.log

...JRF...
Frances Prindle
Occasional Advisor

Re: commands

We have tried all of these commands and have come up with as many different answers. How is it determined which is the TOTAL USABLE PHYSICAL MEMORY
It is not a problem, but a learning experience.
Curtis Larson
Trusted Contributor

Re: commands

got diagnostics?

echo "sc product MEMORY;info;wait;infolog\ndone\n" | cstm

might need a different syntax for different version of diagnostics. So if product isn't correct syntax try type instead.

depending on what information you want, this will give some good numbers
echo "..." |cstm |
awk '/Memory Board Inventory/ {
flag=1;
}
/Memory Controller Inventory/ {
exit;
}
{if ( flag == 1 ) print $0;} '

Curtis Larson
Trusted Contributor

Re: commands

if your not interested in details:
/usr/sam/lbin/getmem
Bill Hassell
Honored Contributor

Re: commands

Of the tools:

# top
Never have figured out what those numbers mean exactly...installed physical memory is not reported though

# dmesg
Only works if your console has not pushed the information off the top of the incore buffer.

# glance
glance -m works every time. The Phys Mem reports installed memory.

# grep -i physical /var/adm/syslog/OLDsyslog.log
Should work but often fails because a cron job is truncating syslog.

# /usr/sam/lbin/getmem
Doesn't seem to provide the correct info for 11.0 and 11i

Here's a simple script to ask the kernel:

MAJOREV=$(uname -r|cut -f 2 -d .)
if [ $MAJORREV -ge "11" ]
then
MYSYMBOL="phys_mem_pages"
else
MYSYMBOL="physmem"
fi

MYMEM=$(echo "${MYSYMBOL}/D" | adb /stand/vmunix /dev/kmem | grep "${MYSYMBOL}: *." | awk '{print int($2*4/1024+.5)}')

echo $MYMEM


Bill Hassell, sysadmin