System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Command to find out total physical memory

 
SOLVED
Go to solution
點燃
Valued Contributor

Command to find out total physical memory

What is the command to find out total physical memory installed in an hp-ux machine?

Dmesg|grep physical & wc -c /dev/mem are does not seem to be working.

Thanks!
Man's mind, once stretched by a new idea, never regains its original dimensions
6 REPLIES
sujit kumar singh
Honored Contributor
Solution

Re: Command to find out total physical memory

hi
there is a typo that you are making in the dmesg

do like this

run this as the root user.

#dmesg| grep -i physical

if errors are found please post the errors.

What does the #swapinfo -tam and #top show

also you can see running
#print_manifest
#cstm also can be helpful.

Regards
Sujit
Pete Randall
Outstanding Contributor

Re: Command to find out total physical memory

There are many ways to do this - here are a couple:

HPUX=/stand/vmunix
MAJORREV=$(uname -r | cut -f2 -d .)
if [ $MAJORREV -ge "11.0" ]
then
MYSYMBOL="phys_mem_pages"
else
MYSYMBOL="physmem"
fi

MYMEM=$(echo "${MYSYMBOL}/D" \
| adb $HPUX /dev/kmem \
| grep "${MYSYMBOL}: *." \
| awk '{printf "%.0f MB\n",$2/256}')
echo $MYMEM




Support Tools Manager (STM) RAM info:

echo "selclass qualifier memory;info;wait;infolog" | cstm




Pete

Pete
Ganesan R
Honored Contributor

Re: Command to find out total physical memory

Hi Pradeesh,

Use these commands.

# echo "selclass qualifier memory;info;wait;infolog" | /usr/sbin/cstm | grep 'Total Configured'
# echo "selclass qualifier memory;info;wait;infolog" | /usr/sbin/cstm | awk '/Total Configured/{print $5}'|head -1

You can also use SAM to find the physical memory.
Best wishes,

Ganesh.
Arturo Galbiati
Esteemed Contributor

Re: Command to find out total physical memory

Hi,
# To get RAM size in KB
perl -e 'local($PSTAT,$PSTAT_STATIC,$mem_info,$PSTAT_STRUCT)=(239,2,"\0"x120,"LI4L");
syscall($PSTAT,$PSTAT_STATIC,$mem_info,length($mem_info),1,0);
print "RAM=".int((unpack($PSTAT_STRUCT,$mem_info))[4]*((unpack($PSTAT_STRUCT,$mem_info))[5])/(1024*1024))."\n";'

HTH,
Art
Sani
Frequent Advisor

Re: Command to find out total physical memory

Hi Pradeesh ,

You can use "machinfo" also

#machinfo|grep Memory


Regards
Sanil
點燃
Valued Contributor

Re: Command to find out total physical memory

Thanks for all the responses.

The issue resolved.
Man's mind, once stretched by a new idea, never regains its original dimensions