1836104 Members
2640 Online
110089 Solutions
New Discussion

System RAM memory

 
Paul Clayton
Frequent Advisor

System RAM memory

How do I find the total system ram memory installed. I need to parse the info to a script. SAM does not work for me, and swapinfo gives incorrect results.

Thanx
9 REPLIES 9
Ian Dennison_1
Honored Contributor

Re: System RAM memory

follow this thread,...

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xc75d50011d20d6118ff40090279cd0f9,00.html

Cheers, Ian Dennison
Building a dumber user
Joseph Chakkery
Valued Contributor

Re: System RAM memory

Try the following.

typeset -i mem=$(grep Physical /var/adm/syslog/syslog.log | awk '{print $7}')
echo $(hostname) has $mem bytes memory.+- $(( $mem /1024 )) mb

Regards
Joe.

Knowledge is wealth
Peter Kloetgen
Esteemed Contributor

Re: System RAM memory

Hi,

what is your needed information?

--> systems total physical memory?

--> system memory + swapspace?

--> available swapspace only?

which output do you want, KB or MB?

please post what you want exactly.

Allways stay on the bright side of life!

Peter
I'm learning here as well as helping
James R. Ferguson
Acclaimed Contributor

Re: System RAM memory

Hi:

If a view of physical memory is what you seek, including DIMM sizes and arrangements, use this:

# echo "selclass qualifier memory;info;wait;infolog"|cstm > /tmp/meminfo

Regards!

...JRF...
Sanjay_6
Honored Contributor

Re: System RAM memory

Hi,

Try this,

echo phys_mem_pages/D |adb /stand/vmunix /dev/mem

Hope this helps.

Regds
Sanjay_6
Honored Contributor

Re: System RAM memory

Hi,

If you want to find out the size of memory modules on your system, the slots being used, try this,

echo 'selclass qualifier memory;info;wait;infolog'|cstm >/tmp/meminfo.txt

Hope this helps.

Regds
SHABU KHAN
Trusted Contributor

Re: System RAM memory

P,

If you would like to script this... The easiest and most efficient way to do is:

To print on stdout:

awk -F ": " '/Ph/{print $3}' /var/adm/syslog/syslog.log | awk '{print $1}'

To capture it in a variable:

TOT_MEMORY=`awk -F ": " '/Ph/{print $3}' /var/adm/syslog/syslog.log | awk '{print $1}'`

Hope this helps !

-Shabu
Patrick Wallek
Honored Contributor

Re: System RAM memory

If you have Ignite/UX installed here is another method. Though it is a bit slow, it will give you the output in MB.

RAM=`/opt/ignite/bin/print_manifest | grep "Main Memory" | awk '{ print $3 }'`
SHABU KHAN
Trusted Contributor

Re: System RAM memory

Hi,

Well, I think the print_manifest command actually parses the manifest file (also manifest.info)... so basically you could do this.. instead of running the print_manifest command (save some time :-))

TOT_MEMORY_MB=`awk '/Memory/{print $3}' /opt/ignite/data/tutorial/manifest`

-Shabu