[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs

Paging Space Programming Requirements

The amount of paging space required by an application depends on the type of activities performed on the system. If paging space runs low, processes may be lost. If paging space runs out, the system may panic. When a paging space low condition is detected, additional paging space should be defined.

The system monitors the number of free paging space blocks and detects when a paging space shortage exists. The vmstat command obtains statistics related to this condition. When the number of free paging space blocks falls below a threshold known as the paging space warning level, the system informs all processes (excepts kprocs) of the low condition by sending the SIGDANGER signal.

Note: If the shortage continues and falls below a second threshold known as the paging space kill level, the system sends the SIGKILL signal to processes that are the major users of paging space and that do not have a signal handler for the SIGDANGER signal (the default action for the SIGDANGER signal is to ignore the signal). The system continues sending SIGKILL signals until the number of free paging space blocks is above the paging space kill level.

Processes that dynamically allocate memory can ensure that sufficient paging space exists by monitoring the paging space levels with the psdanger subroutine or by using special allocation routines. Processes can avoid being ended when the paging space kill level is reached by defining a signal handler for the SIGDANGER signal and by using the disclaim subroutine to release memory and paging space resources allocated in the data and stack areas, and in shared memory segments.

Other subroutines that can assist in dynamically retrieving paging information from the VMM include the following:

mincore Determines the residency of memory pages.
madvise Permits a process to advise the system about its expected paging behavior.
swapqry Returns paging device status.
swapon Activates paging or swapping to a designated block device.

Related Information

Program Address Space Overview.

Understanding System Memory Allocation.

Paging Space Overview.

Related Information

Virtual Memory Manager (VMM) in AIX Performance Tuning Guide describes the VMM and its page-stealing algorithms in detail.

Memory Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts describes the various kernel extensions available to manipulate kernel memory.

Paging Space Overview in AIX Version 4.3 System Management Guide: Operating System and Devices.

_end, _etext or _edata Identifier in AIX Version 4.3 Technical Reference: Base Operating System and Extensions Volume 1.

ipcs command, ipcrm command, vmstat command, pagesize command, update command in AIX Version 4.3 Commands Reference.

ftok subroutine, fsync subroutine, monitor subroutine, moncontrol subroutine, monstartup subroutine in AIX Version 4.3 Technical Reference.


[ Previous | Next | Contents | Glossary | Home | Search ]