When your program is finished using an area of virtual storage,
it can release the storage to make the central, expanded, or auxiliary
storage that actually holds the data available for other uses. The
decision to release the storage depends on the size of the storage
and when the storage will be used again:
- For large areas (over 100 pages, for example) that will not be
used for five or more seconds of processor time, consider releasing
the storage. If you do not release those pages after you are finished
using them:
- Your program might be using central storage that could better
be used for other purposes.
- Your program might have delays later when the system moves your
pages from central storage to expanded or auxiliary storage.
- Generally, for smaller amounts of storage that will be used again
in five seconds or less, do not release the storage.
Note that releasing storage does not free the virtual storage.
When releasing storage for an address
space, use PGRLSE or PGSER with the RELEASE parameter. As shown in Figure 1, if the specified addresses are not on page boundaries,
the low address is rounded up and the high address is rounded down;
then, the pages contained between the addresses are released.
Note: PGRLSE, PGSER RELEASE, PGSER FREE with RELEASE=Y, and PGFREE
RELEASE=Y may ignore some or all of the pages in the input range and
will not notify the caller if this was done.
Any pages in the input range that match any of the following conditions
will be skipped, and processing continues with the next page in the
range:
- Storage is not allocated or all pages in a segment have not yet
been referenced.
- Page is in PSA, SQA or LSQA.
- Page is V=R. Effectively, it's fixed.
- Page is in BLDL, (E)PLPA, or (E)MLPA.
- Page has a page fix in progress or a nonzero FIX count.
- Pages with COMMIT in progress or with DISASSOCIATE in progress.
Figure 1. Releasing
Virtual Storage
When releasing storage for a data space
or hiperspace, use the DSPSERV RELEASE macro to release the central,
expanded or auxiliary storage that actually holds the data. PGSER
RELEASE rejects any attempt to release protected storage, including
storage that is dynamically protected through PGSER PROTECT. The starting
address must be on a 4K-byte boundary and you can release data space
storage only in increments of 4K bytes.
For both address spaces and data spaces, the virtual space remains,
but its contents are discarded. When the using program can discard
the contents of a large virtual area (one or more complete pages)
and reuse the virtual space without the necessity of paging operations,
the page release function may improve operating efficiency.