[hobbit] Important ! HP-UX and the memory utilisation

Henrik Stoerner henrik at hswn.dk
Thu Jul 27 18:57:32 CEST 2006


On Thu, Jul 27, 2006 at 02:46:07PM +0200, thomas.seglard.enata at cnp.fr wrote:
> Thanks for your explanation ! I'm sorry to insist but it's a bit hard to 
> understand. I think the true problem is the "reserved" memory. It's a 
> maximum value and may not be used totally. For me, the real information is 
> on the first line and given by the swapdisk. In my example, I got a total of 
> 24G for swapping (also called paging by HP) and only 23% is used. 
>
> Moreover, to determine the total physical memory used, a little script 
> called "hpux_memory" is launched. I got very different results between 
> this script and "swapinfo -Mm" :
> 
> bash-3.00$ ./hpux-meminfo 
> Total:16372
> Free:212
> 
> So, on my hobbit display I got percentage of memory utilisation > 95% 
> whereas I got 29% with the other command !! Where is the truth ?!
> 
> bash-3.00$ /usr/sbin/swapinfo -Mm
>             Mb         Mb         Mb        PCT
> TYPE      AVAIL    USED    FREE  USED
> memory  16372   4770     11602     29%

hpux-meminfo.c uses two HP library functions to get the memory
details: 

	pstat_getstatic(&sbuf, sizeof(sbuf), 1, 0);
This provides the amount of RAM installed, and appears to agree
with your "swapinfo -Mm" output (both say 16372).

	pstat_getdynamic(&dbuf, sizeof(dbuf), 1, 0);
This returns a "struct" (table of values) where the "psd_free" item is
described as "Physical pages that the system considers to be unused and 
available to processes". (I believe this is described in the
/usr/include/sys/pstat.h file). Through some calculations using the
pagesize value also returned by pstat_getstatic, it reaches the
value you get for MB free memory.

I'm not saying one or the other value is the "right" one, I don't have
enough knowledge of HP-UX to judge which one is right. If the HP-UX
knowledgable people around this list can let me know how to best 
determine the memory pressure, I'll be happy to re-do the HP-UX code
to work with that.


> For the swap or paging memory, "swapinfo -dm" :

The Hobbit client uses "swapinfo -tm". According to the HP-UX manpage,
you only get a subset of the swap space information when using the "-d"
option, which results in a misleading total: 

    -t Add a totals line with a TYPE of total. This line totals only 
       the paging information displayed above it, not all paging areas; 
       this line might be misleading if a subset of -dfrM is specified
    -d Print information about device paging areas only. 
    -f Print information about file system paging areas only.
    -r Print information about reserved paging space only.
    -M Print information about memory paging space only.

(From http://docs.hp.com/en/B2355-90692/swapinfo.1M.html)


Regards,
Henrik




More information about the Xymon mailing list