Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Tunable Kernel Parameters: HP-UX Release 11i Version 1.6 > Chapter 7 Memory Paging Subsystem

Overview of Memory Paging Parameters

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

Configurable kernel parameters for memory paging enforce operating rules and limits related to virtual memory (swap space). They fall into the following categories:

Total System Swap

Maximum swap space that can be allocated, system-wide. Parameters include: swchunk.

Device Swap

Swap space allocated on hard disk devices. Parameters include: nswapdev.

File System Swap

Swap space allocated on mounted file systems. Parameters include: allocate_fs_swapmap and nswapfs.

Pseudo-Swap

Use of installed RAM as pseudo-swap, allowing virtual memory space allocation beyond the limit of swap space on disk devices. Parameters include: swapmem_on.

Variable Page Sizes

The size of virtual memory pages can be altered to make swap operations more efficient in particular applications. Parameters include: vps_ceiling, vps_chatr_ceiling, and vps_pagesize.

Total System Swap

The swchunk parameter determines the size of each chunk of swap area that is created on successive devices or file systems. Selecting an appropriate value for this parameter requires extensive knowledge of kernel operation and system internals. Without such knowledge, do not change swchunk to a nondefault value.

Device Swap

When devices are connected to the system and configured, part of the disk can be reserved for device swap. The only configurable kernel parameter related to device swap is nswapdev, which specifies how many devices have been configured with space allocated for device swap. Data structure storage space is reserved in the kernel for nswapdev devices.

  • If the value of nswapdev is greater than the actual number of swap devices, the small amount of memory space (<50 bytes per device) allocated for data structures to support nonexistent devices is wasted and cannot be used for other purposes.

  • If nswapdev is less than the number of available swap devices, only nswapdev devices can be accessed because no data structure storage space is available for supporting the remaining devices.

File System Swap

In addition to swap space on individual devices, swap space can also be created in existing mounted file systems. This file system swap is somewhat slower than device swap because it must be handled by reading from and writing to open files rather than transferring data directly between the operating system and the disk device. nswapfs is the file system swap counterpart to nswapdev and defines how many locally mounted file systems can be configured system-wide to support file system swap. Like nswapdev, nswapfs should be set to match the actual number of file systems that are normally mounted and intended to be used for file system swap (about nswapfs times 300 bytes of kernel space is required for data structure storage). Only hard disk read/write file systems can be used for file system swap.

A second configurable parameter, allocate_fs_swapmap can be set to enable or disable the allocation of swap space at the time swapon() is called rather than waiting to allocate space using malloc(). Preallocating space ensures the unconditional availability of file system swap space when malloc() is called (otherwise a file-system-full error could occur in some circumstances). Preallocation of file system swap space when swapon() is called is commonly used when high availability is important, but it does prevent other processes from using any resources that are not being use by the process that reserved them.

Pseudo-Swap

Memory allocation is normally based on the availability of virtual memory (swap space available on disks and file systems). Total available (swappable) memory is the same as total swap space. However, on large systems with massive amounts of installed RAM this can lead to inefficiencies.

Consider a system, for example, that contains 200 MB of RAM, and has 1 GB of swap on the root disk. It is inappropriate to limit such a system running in single-user mode with only the root disk mounted to only 1 GB of memory space when the kernel occupies only 10% or less of the available system RAM. By allowing the use of pseudo-swap, any unused RAM can also be allocated for use by the swap system, allowing larger, more demanding processes to run. On a workstation with 100 or 200 MB of swap on the root device and 16 MB of RAM, the advantage of this capability is much less significant.

swapmem_on is used to enable or disable the allocation of pseudo-swap space in system RAM.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 2000-2003 Hewlett-Packard Development Company, L.P.