HP-UX 11i v3 Memory Management Subsystem
3
Introduction
The purpose of this paper is to explain the aspects of the HP-UX 11i v3 memory management subsystem relevant to
obtaining the best possible computing experience. The first section “
Tools to ”, describes the tools and utilities that
can be used to gain insight into the operation of the subsystem. The second section, “
Configuration and tuning
opportunities”, explores the configuration and tuning opportunities available to the system administrator. The final
section, “
Considerations for application developers”, gives a brief introduction to the attributes of memory
management relevant to application developers.
Basic memory management technology is covered in the main body of this document. Advanced technical
information appears in the appendices, for additional reference. All of the commands and interfaces illustrated in
this paper have manpages that can be consulted for more detailed information about usage and for additional
options.
The memory management subsystem has been enhanced with each successive release of HP-UX. This paper
describes HP-UX 11i v3. Features introduced since the initial release of HP-UX 11i v3 are noted in
appendix 1.
Most aspects of memory management are independent of the hardware platform architecture. Where there are
variations with platform architecture, this paper will describe the behavior on Integrity platforms. Differences in
memory management on HP Integrity platforms versus HP9000 PA-RISC platforms are described in
appendix 2.
The other appendices feature
operation of the pager, management of swap space, and the source code for the
locinfo program.
The memory management subsystem
The purpose of the memory management subsystem is to control all of the physical memory in a computer system
and make that memory available to other parts of the operating system and application programs. Physical
memory, also called core or RAM, is the fast, non-persistent storage residing on the computer motherboard in
packages called DIMMs. For application programs, the memory is made available only through a set of
abstractions called virtual memory. From the viewpoint of application programs, virtual memory is
• laid out according to the memory model of the source programming language, concealing the fact that the
physical memory may be of limited size and/or non-contiguous.
• private to the program and protected from access by other programs, unless explicitly shared through the
interfaces provided for that purpose.
To handle the case where the memory usage of all application programs exceeds the capacity of the physical
memory in the computer, the memory management subsystem must also control some storage, nearly always on
disk, called swap space. Any data in memory not in active use at that instant can be copied into the swap space to
make the memory space available for some other purpose. When the data in swap is needed again, it can be
copied from the storage back into memory.
HP-UX is no longer limited to swapping out entire processes – instead, paging is used to relieve memory pressure.
The historical name has been retained, but it is more accurate to think of the storage as "paging space".
Because the access times for disks are much longer than memory access times, the behavior of the memory
management subsystem exerts a profound influence over total system performance. This paper provides information
to help make that performance as good as possible.
Tools to examine the memory management subsystem
The main tools and utilities used to gain insight into the behavior of the memory management subsystem are top,
swapinfo, glance, and sar. For NUMA systems configured with local memory, the pstat_getlocality() system call
shows how the memory is distributed. An example program,
locinfo, shows how this call can be useful. The
command
ipcs displays information about shared memory usage. Beyond these tools, HP technical support teams
have specialized tools to probe into the internals of memory management subsystem operation. Those are not
described in this paper -- the support teams can install those tools to analyze the more complex situations.