z/OS MVS Programming: Extended Addressability Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Creating guard areas and changing their sizes

z/OS MVS Programming: Extended Addressability Guide
SA23-1394-00

A program can create a memory object that consists of two areas:
  • An area it can use immediately, called the usable area
  • A second area, called a guard area
The system does not allow programs to use storage in the guard area. Additional guard areas within the memory object can also be created.
To create a memory object with a guard area, use the SEGMENTS, GUARDSIZE, and GUARDLOC parameters on the IARV64 GETSTOR request. Use the SEGMENTS parameter to specify the size, in megabytes, of the memory object. Use the GUARDSIZE parameter to specify the size, in megabytes, of the initial guard area. Use GUARDLOC=LOW or GUARDLOC=HIGH to specify whether the initial guard area is to be at the low end of the memory object or at the high end.
Note: A request to create a guard area when the range contains fixed pages results in an abend.

Use a guard area to reserve the area for future use. For example, a program can manage the parceling out of pages of the memory object. Another reason for using a guard area is so that the program requesting the memory object can protect itself from accidentally referencing storage beyond the end of the memory object, and possibly overlaying data in another adjacent memory object. For that, the program would use GUARDLOC=HIGH. If the program wanted to protect itself from another program that might be using an adjacent memory at a lower address, it would likely use GUARDLOC=LOW.

Use COND=YES when invoking the IARV64 REQUEST=CHANGEGUARD request, conditionally requesting the change, to avoid an abend if the request exceeds the MEMLIMIT established by the installation. If it cannot grant a conditional request, the system rejects the request, but the program continues to run.

The following illustration shows a memory object, eight segments in size. GUARDLOC=HIGH creates the guard area at the highest addresses of the memory object. The memory object has seven segments of usable storage and one segment on reserve for later use.
Figure 1. A memory object eight megabytes in size
ieaa5v03

Use the IARV64 CHANGEGUARD request to increase or decrease the amount of usable space in a memory object by adjusting the size of the initial guard area or creating and removing additional guard areas. Use the MEMOBJSTART keyword to increase or decrease the initial guard area. Use the CONVERTSTART keyword to create, increase, or decrease guard areas at specific addresses. If any storage of the request is already in the requested state, usable or guarded, CHANGEGUARD processes the request and returns a code of four as a warning.

The following illustration shows an additional guard area of two segments being created in the already defined memory object. This guard area is being created at a specific address, three segments within the memory object. Now the memory object has five segments of usable storage and three segments of unusable (guarded) storage.

Figure 2. A memory object with an additional guard area
ieaa5v04

Your program cannot reference an address in the guard areas; if it does, the program receives a program exception (0C4 abend). To avoid abend, code a recovery routine to get control upon receiving the program exception; the recovery routine can retry and then increase the usable part of the memory object thus decreasing the guard areas.

The guard areas do not count towards the MEMLIMIT set by the installation; the usable areas do count toward the MEMLIMIT.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014