The system uses a combination of paging and swapping to manage virtual memory. Paging involves writing unreferenced pages from real memory to disk periodically.

Swapping takes place if the system is unable to maintain a large enough free pool of memory. In such a case, entire processes are swapped. The pages associated with these processes can be written out by the pager to secondary storage over a period of time.

The more real memory a system has available, the more data it can access and the more (or larger) processes it can execute without having to page or cause swapping.

Available memory

A portion of real memory is always reserved for the kernel (/stand/vmunix) and its data structures, which are dynamically allocated. In addition, memory is reserved for nonkernel system processes. The amount of real memory that remains is available for user processes. This memory is known as available memory and is the memory amount reported by prmavail. Available memory varies over time. Because the size of the kernel varies depending on the number of interface cards, users, and values of the tunable parameters, available memory varies from system to system.

For example, Table 7 (page 27) shows a system with 1024 Mbytes of physical memory. Approximately 112 Mbytes of that memory is used by the kernel and its data structures, leaving 912 Mbytes of memory available for all processes, including system processes. In this example, 62 Mbytes are used by system processes, leaving 850 Mbytes of memory available for user processes. PRM reserves 11% of the remaining memory in the example to ensure processes in PRM_SYS have immediate access to needed memory. Although you cannot initially allocate this reserve to your PRM groups, it is still available for your PRM groups to borrow from when needed. So, in this example, the prmavail command would show 850 Mbytes of available memory before PRM is configured, and 756 Mbytes of available memory after PRM is configured.

Table 7 Example of available memory on a 1024-Mbyte system

Mbyte

Memory type

1024

Physical memory available on the system

912

Memory available for all processes

850

Memory available for user processes

756

Memory available after PRM is configured

How PRM controls memory usage

PRM memory management allows you to prioritize how available memory is allocated to user and application processes. This control enables you to ensure that critical users and applications have enough real memory to make full use of their CPU time.

When PRM first starts and is configuring memory management, the PRM_SYS group (PRMID 0) is in control of all usable memory on the system. The memory not needed by processes in PRM_SYS, known as available memory, is the memory reported by prmavail. This remaining memory is allocated to the other PRM groups, according to their entitlements. The amount of available memory may fluctuate up or down based on the needs of the kernel, buffer cache, daemons, and other processes in PRM_SYS.

PRM’s memory management is controlled by the daemon prm2d. This daemon uses an in-kernel memory feature to partition memory (when a configuration is loaded), with each PRM group getting a partition. Each partition includes x Mbytes of memory, where x Mbytes is equivalent to the group’s entitled percent of the available memory or the requested, fixed-size shared memory allocation. Each partition pages separately.

When system memory use is not at 100%, a PRM group that does not have its memory use capped or isolated can freely borrow excess memory pages from other PRM groups. If a process requires

How PRM manages real memory resources 27

Page 27
Image 27
HP Process Resource Manager (PRM) manual Available memory, How PRM controls memory usage