HP-UX 11i v3 Memory Management Subsystem
15
The HP-UX Virtual Partitions Administrator's Guide contains more detailed recommendations for configuring base
and floating memory in vPars scenarios.
System base page size
A base page is the unit of physical memory management in the HP-UX kernel. It is the smallest block of physical
memory that can be allocated for storing data and code and it is the smallest unit of memory protection.
The size of a base page is a tunable parameter for Integrity platforms starting with the September 2008 Update to
HP-UX 11i v3. The parameter is tunable, but any change requires a reboot to take effect.
The getconf(1) command can be used to obtain the base page size of the system. The base page size is tuned
by invoking the
kctune(1M)command to change the kernel tunable parameter base_pagesize. The possible
values for this page size are 4 KB [the default], 8 KB, and 16 KB. (The page size 64 KB is also supported, but it is
intended solely for the use of the Integrity Virtual Machines host, and is too large for other uses.)
A larger base page size always reduces the kernel memory footprint, and some memory management operations
become more efficient. In general, memory allocations are rounded up to a multiple of the base page size, which
may be wasteful if many small memory objects are created by applications. Most application workloads measured
at HP show a modest (1% to 4%) performance increase when the page size is 16 KB instead of the default 4 KB.
Unfortunately, none of the analysis tools mentioned in this paper can predict what workloads will benefit from the
larger page size. Experimentation in a controlled environment is the best way to determine the optimal page size.
In cases where the kernel memory footprint is of primary importance, the larger base page sizes incur less memory
overhead. The fixed per-page overhead consumes just over 7% of memory when the page size is at its 4 KB
default; this is reduced to approximately 3.6% for 8 KB pages and 1.8% for 16 KB pages.
Configuring swap space
The primary command for configuring swap space is swapon(1M), which directs that storage be made available
as swap space to support paging activity. HP-UX always reserves sufficient swap space for each process that is
created. If the system does not have enough swap space to sustain a new process, the attempt to create it will fail.
Similarly, if an existing process attempts to allocate more memory such that swap space would be exhausted, the
allocation attempt will fail. For those reasons, you should consider adding swap space when the
swapinfo
command indicates that the amount of free swap space is small. If the additional swap space is needed only to
support additional reservations for a larger process address space, it may be more convenient to add swap on a
part of a file system, as the slower performance is not a consideration unless the swap space is actually used.
If there is an abundance of unused swap space, the counterpart command swapoff(1M) can discontinue the use
of a device for swap, making it available for some other purpose.
Sizing the filecache
The minimum and maximum amounts of memory devoted to caching file data are controlled by the tunable kernel
parameters
filecache_min(5) and filecache_max(5). Memory in the fraction specified by the parameter
filecache_min is dedicated exclusively to accelerating file I/O activity. The memory is not available for any
other purpose, even if it is not needed to cache file data. The parameter
filecache_max specifies the maximum
size of the filecache. Memory space beyond
filecache_max is used for other purposes, such as caching
process dynamic data and kernel data.
As long as the filecache is below its maximum size, it will grow in response to accesses to additional file data.
Once the limit established by
filecache_max is reached, cached file data will be pushed from memory to the file
system to make room for newly referenced file data.
The filecache parameters trade-off accelerated performance for file I/O activity against all other competing uses for
memory. The default settings of the parameters reserve approximately 5% of physical memory for the filecache, but
do not allow it to grow past 50% of physical memory. An extensive survey of the HP-UX customer base showed that
almost 60% of the systems retained the default minimum filecache size of 5%. About 34% of the systems tuned the
filecache_min parameter downward into the range of 1% to 3%. Only 6% of the systems adjusted the
parameter upwards. The customer survey showed that almost one third of the systems retained the default maximum