HP-UX 11i v3 Memory Management Subsystem

5
The total virtual size is always at least as large as the resident size, because the former accounts for all
memory that has been defined by the process, even that which has not been accessed recently, or ever,
and so is not in core.
Swapinfo
The swapinfo(1M) command reveals information about the size and utilization of swap space. For the example
below, the command was invoked as
swapinfo -mt to display values in megabytes instead of kilobytes, and to
provide a row showing the totals.
# /usr/sbin/swapinfo -mt
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8192 0 8192 0% 0 - 1 /dev/vg00/lvol2
localfs 64 0 64 0% 64 125 2 /tmp/paging
reserve - 8256 -8256
memory 249096 116070 133026 47%
total 257352 124326 133026 48% - 125 -
The first row under the headings shows swap space of the type dev; that is, an entire physical disk device or
logical volume, in this case
/dev/vg00/lvol2. The second row shows swap space of the type localfs; that is,
on a device or logical volume that holds a local file system. In this case, the directory called
paging was created
to provide swap space on the file system
/tmp. Paging to a physical device is faster, but it requires dedicating the
entire device to swap. Paging to a file system incurs more overhead than a device, but the disk space not actually
used for swap is available to store files.
The default policy of HP-UX is to reserve sufficient swap space for every process at the time it is created. This
guarantees that there is always a place to put the data for every process in the system -- it is never necessary to kill a
process because paging out is necessary but swap space is full. The row marked
reserve indicates how much
swap space has been reserved for processes but not actually allocated. To compute the total accurately, the
amount of space so reserved appears with a negative sign under the
FREE column, as it represents a claim upon
space that might have to be allocated at any time.
The calculation as to how much space is needed for all of the system processes includes the portion of memory that
will hold process data. Space accounted for in this way is referred to as "pseudo-swap" and is indicated on the
row marked
memory. Pseudo-swap is used for all memory locked by the kernel or by applications, and also when
all disk swap is exhausted. The operating system decides how much memory should be used for pseudo-swap. It is
never the full amount of physical memory: the amount in the
FREE column is the free pseudo-swap; it is not intended
to match the true amount of free memory reported by the other tools.
This particular system has plenty of swap space. Note that in the total row, only 48% of the available swap
space is actually used. At any utilization less than 80%, the system is operating quite comfortably and has sufficient
swap space. When the swap utilization exceeds 90%, it might be appropriate to add more swap space.
The system also has plenty of memory -- enough so that no memory has actually been swapped out to either of the
swap devices: both the device and the paging file system report 0 space used. Note that the amount of reserved
space matches the sum of the space available on the two swap devices. The rest of the process virtual memory has
pseudo-swap allocated for it.
HP GlancePlus
glance(1M), part of the HP GlancePlus product, is a valuable utility that gives insight into many
aspects of system performance, to include memory utilization and paging activity. Although
glance has a
graphical version for Motif, the examples in this paper are for the text-based version. There is a wealth of
information available through
glance; the four screens most relevant to memory management are illustrated below.
For the examples, the
glance command was invoked with no arguments, and a single keystroke used to select the