System Administration

How to view the memory size (RAM size)

 
SOLVED
Go to solution
Md. Farhan A Azam
Trusted Contributor

Re: How to view the memory size (RAM size)

Hi,

1). Through SAM
#sam> Press "Return" to continue...> Performance Monitors> System Properties> Memory.

2). You can get it through kmeminfo (if kmeminfo is installed).
#cd /tmp
#./kmeminfo


Thnx...Farhan

Suraj K Sankari
Honored Contributor

Re: How to view the memory size (RAM size)

hi,
I always do this below command to check my physical memory.

# dmesg |grep -i physical
or
machinfo
or
nickel

Suraj
Arturo Galbiati
Esteemed Contributor

Re: How to view the memory size (RAM size)

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
Lokman_csl
Occasional Contributor

Re: How to view the memory size (RAM size)

Hi,

 

# glance -m
sh: glance:  not found.

 

Not working.

 

Regards,

 

Lokman

Dennis Handly
Acclaimed Contributor

Re: How to view the memory size (RAM size)

>sh: glance:  not found.

 

You purchase glance separately.

(Try another of the above suggestions, except for dmesg.)

BBphil
Occasional Visitor

Re: How to view the memory size (RAM size)

I manage a number of legacy HP-UX systems from HP-UX 9 to HP-UX 11 and not all have all toos/commands.

Thus I prefer something which works on all flavors.

dmesg does not give the answer if the system was up a long time and the buffer does not hold the boot information anymore. Kernel tools are different on different versions and support tools are often not installed.

Currently I use a combination of dmesg and syslog lookup and check for the Physical memory lines, which gives me a result in most cases.

 

   [[ -d /usr/adm        ]] && SYSLOGdir=/usr/adm
   [[ -d /var/adm/syslog ]] && SYSLOGdir=/var/adm/syslog
         dmesg | cat - $SYSLOGdir/*syslog* \
               | grep Physical: \
               | sed -e 's/.*ical: *//' -e 's/ .*//' \
               | sort -u | awk '{printf( "%d MB\n", $0/1024 )}'