Modernization Hub

Demand Paging

Enhanced Definition

Demand paging is a memory management technique used in z/OS where pages of a program or data are loaded into real storage only when they are actually referenced (demanded) by the CPU. This approach optimizes real storage utilization and enables the execution of applications that are larger than the available physical memory. Demand paging is a memory management technique in z/OS where pages of a program or data are loaded into real storage only when they are actually referenced or "demanded" by the CPU. This approach allows programs to execute even if their total size exceeds the available real memory, optimizing the use of real storage and improving system throughput.

Key Characteristics

    • Virtual Storage Integration: It is a core component of the z/OS virtual storage architecture, working in conjunction with address translation hardware.
    • Page Fault Mechanism: When a program attempts to access a virtual address whose corresponding page is not currently in real storage, a page fault occurs, triggering the operating system to load the required page.
    • Page-in/Page-out Operations: Involves page-in (loading a page from auxiliary storage into real storage) and page-out (writing a modified page from real storage back to auxiliary storage).
    • Auxiliary Storage Reliance: Utilizes auxiliary storage (typically paging datasets on DASD) as a backing store for pages that are not currently resident in real memory.
    • Working Set Management: Aims to keep the working set (the set of pages actively being used by a program) in real storage to minimize page faults and optimize performance.
    • Dynamic Allocation: Pages are allocated to real storage dynamically as needed, rather than pre-loading entire programs.

Use Cases

    • Large Application Execution: Enables the execution of large COBOL batch jobs, CICS regions, or DB2 subsystems whose total virtual storage requirements exceed the available real storage.
    • Multiprogramming and Multitasking: Facilitates efficient multiprogramming by allowing numerous address spaces to share limited real storage, with only their currently active pages present.
    • System Resource Optimization: Reduces the real storage footprint of inactive or less frequently accessed parts of programs and data, making more real storage available for active workloads.
    • Virtual Storage Constraint Relief: A fundamental mechanism that provides virtual storage constraint relief by decoupling the size of an application from the physical memory limits.

Related Concepts

Demand paging is intrinsically linked to the z/OS virtual storage management system, which maps virtual addresses to real storage addresses. It heavily relies on paging datasets on DASD as the external repository for pages not currently in real storage. The Workload Manager (WLM) indirectly influences demand paging by managing system resources and dispatching priorities, which can affect an address space's access to real storage and its likelihood of experiencing page faults.

Best Practices:
  • Monitor Paging Rates: Regularly monitor system-wide and address space-specific paging rates using tools like RMF or SMF data to identify excessive paging (thrashing).
  • Optimize Program Locality: Design and structure applications (e.g., COBOL programs) to exhibit good locality of reference to minimize the number of distinct pages accessed over short periods, thereby reducing page faults.
  • Configure Paging Datasets: Ensure sufficient, properly sized, and strategically placed paging datasets on fast DASD to handle paging I/O efficiently and avoid I/O bottlenecks.
  • Allocate Sufficient Real Storage: Provide adequate real storage to z/OS LPARs to reduce the overall system's reliance on paging, especially for critical workloads.
  • Tune WLM Policies: Adjust WLM policies to assign appropriate importance and resource goals to critical workloads, allowing WLM to prioritize their access to real storage and minimize their paging activity.

Related Products

Related Vendors

HP

5 products

IBM

646 products

Related Categories

Operating System

154 products