|
HEAP
controls the allocation of the initial heap, controls allocation of
additional heaps created with the CEECRHP callable service, and specifies
how that storage is managed.
Heaps are storage areas where
you allocate memory for user-controlled dynamically allocated variables
such as: - C variables allocated as a result of the malloc(), calloc(),
and realloc() functions
- COBOL WORKING-STORAGE data items
- PL/I variables with the storage class CONTROLLED, or the storage
class BASED
The HEAP option is always in effect. If you do not specify
HEAP, Language Environment allocates
the default value of heap storage when a call is made to get heap
storage.
Language Environment does
not allocate heap storage until the first call to get heap storage
is made. You can get heap storage by using language constructs or
by making a call to CEEGTST.
- Non-CICS default
- HEAP=((32K,32K,ANYWHERE,KEEP,8K,4K),OVR)
- CICS® default
- HEAP=((4K,4080,ANYWHERE,KEEP,4K,4080),OVR)
Syntax
.-ANYWHERE-.
>>-HEAP--=--(--(--init_size--,--incr_size--,--+-ANY------+--,--->
'-BELOW----'
.-KEEP-. .-OVR----.
>--+-FREE-+--,--initsz24--,--incrsz24--)--,--+-NONOVR-+--)-----><
- init_size
- Determines the minimum initial allocation of heap storage. Specify
this value as n, nK,
or nM bytes of storage. The actual amount
of allocated storage is rounded up to the nearest multiple of 8 bytes.
- incr_size
- Determines the minimum size of any subsequent increment to the
heap storage. Specify this value as n, nK,
or nM bytes of storage. The actual amount
of allocated storage is rounded up to the nearest multiple of 8 bytes.
- ANYWHERE|ANY
- Specifies that you can allocate heap storage anywhere in storage.
If there is no available storage above the line, storage is acquired
below the 16 MB line.
The only valid abbreviation of ANYWHERE
is ANY.
- BELOW
- Specifies that you must allocate heap storage below the 16-MB
line in storage that is accessible to 24-bit addressing.
- KEEP
- Specifies that storage allocated to HEAP increments is not released
when the last of the storage is freed.
- FREE
- Specifies that storage allocated to HEAP increments is released
when the last of the storage is freed.
- initsz24
- Determines the minimum initial size of the heap storage that is
obtained when an application running AMODE 24 (ALL31(OFF)) requests
storage and ANYWHERE has been specified. An AMODE 31 application running
with ALL31(OFF) uses the regular heap allocation size. Specify initsz24 as n, nK,
or nM number of bytes. The amount of storage
is rounded up to the nearest multiple of 8 bytes.
initsz24 applies
to the initial heap and other heaps created with the CEECRHP callable
service that are not allocated strictly below the 16-MB line.
- incrsz24
- Determines the minimum size of any subsequent increment to the
heap area that is obtained when an application running AMODE 24 (ALL31(OFF))
requests storage and ANYWHERE has been specified. An AMODE 31 application
running with ALL31(OFF) uses the regular heap allocation size. Specify incrsz24 as n, nK,
or nM number of bytes. The amount of storage
is rounded up to the nearest multiple of 8 bytes.
The incrsz24 applies
to the initial heap and other heaps created with the CEECRHP callable
service that are not allocated strictly below the 16-MB line.
- OVR
- Specifies that the option can be overridden.
- NONOVR
- Specifies that the option cannot be overridden.
CICS considerations Both
the initial HEAP allocation and HEAP increments are rounded to the
next higher multiple of 8 bytes (not 4K bytes). If HEAP(0) is specified
the initial HEAP is obtained on the first use and will be based on
the increment size.
If HEAP(,,ANYWHERE,,,) is in effect, the
maximum size of a heap segment is 1 gigabyte (1024 MB). These restrictions
are subject to change from one release of CICS to another.
The default increment
size under CICS is 4080
bytes, rather than 4096 bytes, to accommodate the 16 bytes CICS storage check zone. Without
this accommodation, an extra page of storage is allocated (only when
the storage allocation is below the 16MB line).
z/OS® UNIX considerations The
HEAP option applies to the enclave.
Under z/OS UNIX, heap
storage is managed at the thread level using pthread_key_create, pthread_setspecific,
and pthread_getspecific.
Usage notes - COBOL considerations
- You can use the HEAP option to provide function similar to the VS COBOL II space
management tuning table.
- PL/I MTF
considerations
- In a PL/I MTF
application, HEAP specifies the heap storage allocation and management
for a PL/I main
task.
Performance considerations To improve performance,
use the storage report numbers generated by the RPTSTG runtime option
as an aid in setting the initial and increment size for HEAP.
|