beautypg.com

Monitoring and altering swap files, How kernel-managed swap space works – HP NonStop G-Series User Manual

Page 169

background image

Performing Routine Disk Operations

Guardian User’s Guide 425266-001

9- 23

Monitoring and Altering Swap Files

Monitoring and Altering Swap Files

When all physical memory has been allocated and more memory is needed, data that is
not currently in use is stored on disk:

Pages of memory are “swapped,” or copied, to disk when there is a shortage of
available physical memory.

The memory pages are swapped back to physical memory when the data is accessed.

When swapped to disk, the data is stored in “swap files.”

The NonStop™ Kernel opens one or more swap files for each processor and
manages the files for all the processes that need them.

A kernel-managed swap file is only opened once and is then available to all the
processes running on the processor. Conventional swap files, which are defined by the
calling process rather than the system, must be opened and closed by the system monitor
on each process creation and deletion.

Kernel-managed swap files, which you can control using the Kernel-Managed Swap
Facility (KMSF), offer four main benefits over conventional swap files:

Kernel-managed swap files speed up process creation and deletion.

KMSF uses much less disk space than conventional swap files when backing the
large, sparsely populated address space used by shared run-time libraries (SRLs).

KMSF reduces the time required to resize a segment. The KMSF implementation of
segment resizing requires neither I/O nor dispatches of other processes.

By centralizing swap files, KMSF makes it easier to manage swap space for all
processes on the system.

For more information, see the Kernel-Managed Swap Facility (KMSF) Manual.

How Kernel-Managed Swap Space Works

When a processor is loaded, KMSF reads the kernel-managed swap configuration file
and opens any swap files configured for that processor. If no configuration file or swap
files are found, KMSF attempts to create a default swap file. Each swap file is assigned
to only one processor. There is no limit to the number of swap files that you can have for
each processor—you are limited only by the amount of disk space available.

KMSF receives requests for swap space (which can also be thought of as virtual
memory) from the NonStop™ Kernel and returns swap-space reservations to the
NonStop™ Kernel. A reservation is the agreement to provide up to a stated amount of
space as needed; the space is not allocated all at once, but is allocated as it is needed.
The initial reservation is the amount of swap space requested at creation of a process.

The NonStop™ Kernel swaps to the kernel-managed swap files as needed. As a
process’s need for swap space grows, KMSF increases the reservation. Additional swap
space might be given from a different swap file than that used for the original

This manual is related to the following products: