Modernization Hub

VSM - Virtual Storage Management

Enhanced Definition

Virtual Storage Management (VSM) is a core component of the z/OS operating system responsible for allocating, managing, and deallocating virtual storage within an address space. It provides programs with access to memory without requiring direct knowledge of physical storage, facilitating efficient resource utilization and isolation between applications.

Key Characteristics

    • Virtual-to-Real Mapping: VSM translates virtual addresses used by programs into corresponding real (physical) memory addresses, enabling programs to operate as if they have continuous, dedicated memory.
    • Dynamic Allocation: Programs can dynamically request and release virtual storage during execution using services like GETMAIN, STORAGE OBTAIN, or language-specific functions (malloc in C, ALLOCATE in PL/I).
    • Storage Subpools: Virtual storage is organized into various subpools, each with distinct characteristics regarding fetch protection, storage key, pageability, and ownership, optimizing resource usage and security.
    • Address Space Management: VSM operates within the context of a 2GB (or 16EB for z/Architecture) virtual address space assigned to each active task or user, managing both private and shared storage areas.
    • Paging Integration: It works in conjunction with the z/OS Paging Supervisor to manage the movement of virtual storage pages between real memory and auxiliary storage (DASD) as needed.
    • Storage Protection: VSM enforces storage key protection, preventing unauthorized access or modification of storage areas by programs operating with different storage keys.

Use Cases

    • Program Execution: Every program running on z/OS, from batch jobs to online transactions, relies on VSM to obtain working storage, program buffers, and load modules for execution.
    • Dynamic Data Structures: Applications use VSM to allocate memory for dynamic data structures, arrays, and control blocks whose size may not be known until runtime.
    • System Services and Subsystems: Core z/OS services and major subsystems like CICS, DB2, and IMS extensively use VSM to manage their internal control blocks, buffers, and user data areas.
    • Inter-Address Space Communication: VSM manages shared storage areas (e.g., Common Storage Area - CSA, Extended CSA - ECSA) that allow multiple address spaces to access common data.

Related Concepts

VSM is fundamental to z/OS, working closely with the Paging Supervisor to manage the physical backing of virtual storage by moving pages between real memory and auxiliary storage. It operates within the confines of an Address Space, providing each program with its own virtual memory view while also managing shared system areas. VSM utilizes Storage Keys to enforce protection and isolation, preventing programs from illegally accessing or modifying storage owned by other programs or the operating system. The primary programmatic interfaces for VSM are the GETMAIN and FREEMAIN macros, which allow applications to explicitly request and release virtual storage.

Best Practices:
  • Manage Storage Leaks: Always ensure that dynamically obtained storage is explicitly FREEMAINed when no longer needed to prevent storage exhaustion within an address space, which can lead to abends (e.g., S878, S80A).
  • Use Appropriate Subpools: Select the correct storage subpool (e.g., SP=0 for system-owned, SP=252 for user-owned pageable, SP=230 for user-owned fixed) based on the storage's purpose, ownership, and pageability characteristics to optimize performance and protection.
  • Monitor Virtual Storage Usage: Regularly monitor virtual storage consumption using tools like RMF, DISPLAY VIRTUAL commands, or specialized performance monitors to identify potential issues like fragmentation, excessive growth, or inefficient allocation patterns.
  • Optimize Buffer Sizes: For I/O operations and data processing, allocate buffer sizes that are aligned with physical block sizes and device characteristics to minimize paging and improve data transfer efficiency.
  • Avoid Excessive Small Allocations: Frequent GETMAIN and FREEMAIN calls for small amounts of storage can lead to virtual storage fragmentation and increased overhead; consider allocating larger blocks and managing sub-allocations internally if feasible.

Related Vendors

Tone Software

14 products

IBM

646 products

Trax Softworks

3 products

SOA Software

1 product

Related Categories

Operating System

154 products

Automation

222 products

Browse and Edit

64 products

MQ, Messaging and SOA

76 products