help me decipher how much memory on my box

hi,

if I do top, I get

Memory: 19277012K (5868296K) real, 33860312K (11294208K) virtual, 795392K free  

If I do swapinfo -tm I get:

[23] % swapinfo -tm
             Mb      Mb      Mb   PCT  
TYPE      AVAIL    USED    FREE  USED  
dev       16384       0   16383    0%  
dev       32768    1780   30986    5%  
reserve       -   38016  -38016
memory    65506   27249   38257   42%
total    114658   67045   47610   58%  

so it seems to be that I have 64G of real memory, but why is top reporting otherwise? Can someone please help decipher?

thanks

What is your OS?

An HPUX would say how much memory at boot time:

ant:/sm/cron/bin $ grep Phys /var/adm/syslog/syslog.log
May 21 19:28:28 ant vmunix:     Physical: 8388608 Kbytes, lockable: 6464976 Kbytes, available: 7426824 Kbytes

After you would have to use other tools like glance/gpm stm etc...

In simple language, what you are seeing in top is the reflect of how HPUX works (memory management...) For HPUX memory is "virtual" and so your device swap count as memory...
HPUX till 11.23 (after I have no boxes nor knowledge...) the size of your usable (addressable) memory is the size of your swap

Depending on the kernel parameter swapmem_on (set to 0/1) it will extend the swap size by using some of your RAM... and so extend its "memory".

As you can see, depending how you configured your kernel and swap size you may face different issues: Not enough swap although plenty RAM, and box saying run out of mem resource or boy loading far more than it can afford and swapping like mad...

I will present you 2 cases:
box1 D230 HPUX11 with 1 GB RAM:

ard # grep Phys /var/adm/syslog/titi      
Dec  7 15:22:07 ard vmunix:     Physical: 1048576 Kbytes, lockable: 938336 Kbytes, available: 972940 Kbytes
ard # swapinfo -tam
             Mb      Mb      Mb   PCT  START/      Mb
TYPE      AVAIL    USED    FREE  USED   LIMIT RESERVE  PRI  NAME
dev        1024       0    1024    0%       0       -    1  /dev/vg00/lvol2
reserve       -      41     -41
total      1024      41     983    4%       -       0    -

You could guess by looking at the above outputs that this box swapmem_on is set to 0:
swapmem_on 0 - - -
(TRUE!) And you know this box could not exceed 1 GB memory usage...
If it had swapmem_on on, it would have maybe an extra 200MB of addressable memory...

Box2 : K360 HPUX11...

aco:/var/adm/syslog $ grep Phys /var/adm/syslog/titi
Sep  7 14:51:21 aco vmunix:     Physical: 2097140 Kbytes, lockable: 1797216 Kbytes, available: 1833500 Kbytes
aco:/var/adm/syslog $ swapinfo -tam
             Mb      Mb      Mb   PCT  START/      Mb
TYPE      AVAIL    USED    FREE  USED   LIMIT RESERVE  PRI  NAME
dev        1024       0    1024    0%       0       -    1  /dev/vg00/lvol2
dev        2048       0    2048    0%       0       -    0  /dev/vg00/lvol9
dev        2048       0    2048    0%       0       -    0  /dev/r5vg03/lvol2
reserve       -     318    -318
total      5120     318    4802    6%       -       0    -

2GB RAM - 5GB swap
5GB swap matches the total device swap so?

aco:/var/adm/syslog $ sysdef|grep swapmem
swapmem_on                    0          -           -                   -

swapmem turned off... but 5 GB of memory would be seen...
This allowed me to install 6 oracle (of different versions...)instance plus 1 sybase and more than 600 concurent users and the lot was slow perhaps but was from the beginning and everybody was happy once used to its speed (180Mhz bi-proc..) The most amasing... Never did you have a cursor freeze for a moment even short...

Box3 L2000 HPUX11.11
you comment...

elm:/home/vbe $ grep Phys /var/adm/syslog/syslog.log
Oct  2 12:12:34 elm vmunix:     Physical: 4194304 Kbytes, lockable: 3756084 Kbytes, available: 3499136 Kbytes
elm:/home/vbe $ swapinfo -tam
             Mb      Mb      Mb   PCT  START/      Mb
TYPE      AVAIL    USED    FREE  USED   LIMIT RESERVE  PRI  NAME
dev        3000       0    3000    0%       0       -    1  /dev/vg00/lvol2
dev        1500       0    1500    0%       0       -    2  /dev/vg01/lvol10
reserve       -    1389   -1389
total      4500    1389    3111   31%       -       0    -

How much can be loaded in memory?
And so?

elm:/home/vbe $ sysdef|grep swapmem
swapmem_on                    0          -           -                   -

Now tricky one
Box4 L2000 (RP5450) HPUX11.11

ant:/home/vbe $ grep Physi /var/adm/syslog/syslog.log
May 21 19:28:28 2 ant vmunix:     Physical: 8388608 Kbytes, lockable: 6464976 Kbytes, available: 7426824 Kbytes
ant:/home/vbe $ swapinfo -tam
             Mb      Mb      Mb   PCT  START/      Mb
TYPE      AVAIL    USED    FREE  USED   LIMIT RESERVE  PRI  NAME
dev        4000       0    4000    0%       0       -    1  /dev/vg00/lvol2
dev        4096       0    4096    0%       0       -    1  /dev/vg00/swap3
dev        4096       0    4096    0%       0       -    0  /dev/esvg01/lvol2
reserve       -    1336   -1336
memory     6326    1504    4822   24%
total     18518    2840   15678   15%       -       0    -
ant:/home/vbe $ sysdef|grep swapmem
swapmem_on                    1          -           -                   -

All the best

I cut/pasted below a script I used to use a long time ago to check the available memory on HP and SGI.

#!/bin/ksh
#
TMPFL=/tmp/showsys.tmp;touch $TMPFL
SCRIPTDIR=/scripts
case `uname -s` in
HP-UX*) #Machine type is HP HPUX
if [ `uname -m` = "ia64" ]; then
HPUX=/stand/vmunix
MAJORREV=$(uname -r | cut -f2 -d .)
if [ $MAJORREV -ge "11.0" ]; then MYSYMBOL="phys_mem_pages"; else MYSYMBOL="physmem"; fi
MEM=$(echo "${MYSYMBOL}" | adb $HPUX /dev/kmem | grep "${MYSYMBOL}: ." | awk '{printf "%.0fMB\n",$2/256}')
MHZ=$(echo itick_per_tick | adb $HPUX /dev/kmem | tail -1 | awk '{print $2/10000}')
else
HPUX=/stand/vmunix
MAJORREV=$(uname -r | cut -f2 -d .)
if [ $MAJORREV -ge "11.0" ]; then MYSYMBOL="phys_mem_pages"; else MYSYMBOL="physmem"; fi
MEM=$(echo "${MYSYMBOL}/D" | adb $HPUX /dev/kmem | grep "${MYSYMBOL}: ." | awk '{printf "%.0f MB\n",$2/256}')
MHZ=$(echo itick_per_tick/D | adb -k $HPUX /dev/kmem | tail -1 | awk '{print $2/10000}')
fi
;;
IRIX
) #Machine type is SGI Irix
hinv | grep -i mem>$TMPFL
MEM=`cat $TMPFL | awk '{print $4}'`;MTY=`cat $TMPFL | awk '{print $5}'`
hinv | grep MHZ>$TMPFL
MHZ=`cat $TMPFL | awk '{print $2}'`;
NCP=`cat $TMPFL | awk '{print $1}'`;
;;
AIX
) #Machine type is IBM AIX
MEM=`lsattr -El sys0 -a realmem -F value`
let MEM=$MEM/1024;MTY="Mbytes"
;;
SunOS*) #Machine type is Sun Solaris
echo "Do not know the commands for Sun maybe ask Joe"
exit 0
;;
*) #Machine type is Unknown
echo "Machine type is unknown"
exit 0
;;
esac
rm $TMPFL
echo "Main system memory is $MEM $MTY and $NCP CPU running at $MHZ mhz "
#
#End of script