From: sys_somogyi@sscvx1.ssc.gov
Newsgroups: comp.sys.hp
Subject: <<HP memory mgmt, and my discovery!!>>
Date: 8 Oct 92 16:54:35 GMT
Organization: Superconducting Super Collider Laboratory

I have been experiencing memory related problems on an HP9k720 using
HPUX 8.0.7 as follows:

The system has 80MB of RAM installed.  3-4 users use this system on a daily
basis using HP VUE, softbench, and other HP development tools.  The basic
problem is that all available memory will eventually be consumed in the
course of a week or less without ANY paging or swapping taking place.
In other words, the concept of virtual memory is being ignored by this
system.  The O/S was installed in the "standard" way, taking defaults, etc...

This problem prompted me to do some research where I uncovered/discovered
the following:

   There are 4 terms used to describe RAM and its uses:

   1) physical memory - the entire address space of physical memory,
                        80MB in this case

   2) available memory - the amount of physical memory remaining after
                         the kernel is loaded, ~66MB in our case.

   3) lockable memory - the amount of available memory which can be locked,
                        where locked memory CANNOT be paged or swapped.
                        This does not mean that all lockable memory is
                        actually locked, simply that it is AVAILABLE for
                        locking, at which time it cannot be paged/swapped.

   4) unlockable memory - the amount of available memory which can NEVER
                          be locked.  In other words, the amount of available
                          memory which is ALWAYS available for paging/swapping.

Regarding our problem, it was my guess that memory which was being consumed
was also being locked, so as my first course of action, I decided to adjust
this and then analyze the system further.  The only parameter (as I see it)
available for controlling this behavior is called "unlockable_mem" and can
be found via SAM in the "misc parameters" of the kernel parameters menu.
>>>>>> ALL documentation including online help in SAM indicates that
this parameter (unlockable_mem) is specified in bytes and defaults to 0,
which means that all available memory can be locked, if needed.  This is
probably ok for most systems, but if you want to change it, then you
will discover that the documentation is WRONG!!

After experimentation, I determined that this paramter MUST be specified
in pages, where a page is 4kb (4096 bytes).  As an example, I wanted to
try setting this parameter to 20MB, so instead of specifying 20971520 bytes,
you MUST specify 5120 pages (5120*4096 bytes = 20971520).  If this is not
done, then most likely, most if not all of available memory will become
unlockable, i.e. when I specified 20971520, it took that as 20971520*4096
which by far exceeded the amount available memory.  If this happens, then
the system does not complain, it simply makes no memory available for locking.

In the book "How HP-UX Works: Concepts for the System Administrator" in the
"Memory Management" Chapter page 7-5, it describes lockable memory, etc...
and also states "By default, lockable memory is no more that
three-fourths of available memory."  WHICH IS ABSOLUTELY NOT TRUE, since
the "unlockable_mem" parameter is set to 0 by default.


Dave Somogyi
VMS/Unix System Manager/Admin
SSC (Superconducting Super Collider Project)
somogyi@sscvx1.ssc.gov
Newsgroups: comp.sys.hp