Virtual storage management

The system allocates and releases blocks of virtual storage on request, ensures that real frames exist for SQA, LSQA, and V=R pages, and protects storage with fetch and storage protection keys. It provides this function through the GETMAIN, FREEMAIN, and STORAGE macros. In addition, the system provides the following services through the use of the macros specified:
  • VSMREGN macro: List the starting address and the size of the private area regions associated with a given task
  • VSMLOC macro: Verify that a given area has been allocated through a GETMAIN or STORAGE macro
  • VSMLIST macro: List the ranges of virtual storage allocated in a specified area.

These system services are especially useful when determining available storage, coding recovery procedures, or specifying areas to be included in a dump. VSMREGN enables you to determine the amount of storage that you have for potential use.

z/OS® R2 introduces 64-bit addressing and an address space with an almost unlimited amount of virtual storage above the 2-gigabyte address. The size of the 64-bit address space is 16 exabytes, which makes the new address space 8 billion times the size of the former S/390® address space. Programs continue to be loaded and to run below the 2-gigabyte address; these programs can use data that resides above 2-gigabytes. To allocate and release virtual storage above the 2-gigabyte address, a program issues the IARV64 macro. The GETMAIN, FREEMAIN, STORAGE, and CPOOL macros do not allocate storage above the 2-gigabyte address, nor do callable cell pool services. It is expected that most programs will continue to use virtual storage below the 2-gigabyte address. To learn how to obtain and use storage above the 2-gigabyte address, see Using the 64-bit address space in z/OS MVS Programming: Extended Addressability Guide.

If you need to check whether a GETMAIN or STORAGE macro was issued to allocate a given block of storage, you can use the VSMLOC macro to perform this check. If the given block is located in private area storage, you can also request the address of the TCB that issued the GETMAIN or STORAGE macro. VSMLOC enables you to verify control blocks or storage locations when coding recovery procedures. You can use VSMLOC to check whether a control block has been allocated and to verify that the control block is located in the correct subpool.

VSMLIST enables you to obtain detailed information about virtual storage that could be useful in determining the areas that you might need in a dump and thereby limit the size of the dump. Limiting the size of a dump is especially critical when executing in 31-bit addressing mode because of the amount of storage involved. The use of VSMLIST is described in Obtaining information about the allocation of virtual storage (VSMLIST).

You can use the Page Status Interface Routine (IARQD) to determine the location and status of a page in the storage hierarchy. The use of IARQD is described in Using IARQD — The page status interface routine.