THREADHEAP (non-CICS)
THREADHEAP controls the allocation and management of thread-level
heap storage. Separate heap
segments are allocated and freed for each thread based on the THREADHEAP specification. Library
use of heap storage in a subtask is allocated from the
enclave-level heap storage specified by
the ANYHEAP and
BELOWHEAP options.
THREADHEAP has the following suboptions :
- initial size : the minimum size of the initial thread heap storage, rounded
to the nearest 8 bytes, maximum size of 1 MB
- initial size units : the units that initial size is specified in (K, M)
- increment size : the minimum size of any subsequent
increment to the thread heap area, maximum size of 1 MB
- increment size units : the units that increment size is specified in (K, M)
- ANYHWERE or BELOW :
ANYWHERE allows heap storage to be allocated anywhere in storage. If there is
no storage available above the line, storage is acquired below the line.
BELOW ensures that heap storage must be allocated below the 16 MB line in storage that is
accessible to 24-bit addressing.
- KEEP or FREE :
FREE specifies that storage allocated to THREADHEAP increments is released when the last of
the storage in the thread heap increment is freed.
KEEP specifies that storage allocated to THREADHEAP increments is not released when
the last of the storage in the thread heap increment is freed.
Notes :
- If the requesting routine is running in 24-bit addressing mode and THREADHEAP(,,ANYWHERE,) is in
effect, THREADHEAP storage is allocated below the 16 MB line based upon the HEAP initial size
24 and increment size 24 settings.
- The initial thread heap segment is never released until the thread terminates.
- PL/I consideration : THREADHEAP(4K,4K,ANYWHERE,KEEP) provides behavior compatible
with the PL/I TASKHEAP option.
- MTF consideration : THREADHEAP has no affect on C/C++ or Fortran for z/OS MTF
applications. The thread-level heap is allocated only in applications that use the PL/I MTF.
For PL/I MTF applications, controlled and based variables specified in subtasks are located in
the thread-level heap.
If the main program is
AMODE 24 and THREADHEAP(,,ANYWHERE,) is specified, heap storage is
allocated below the 16 MB line. Storage is only allocated above the line under the following
conditions :
- the user routine requesting the storage is running in 31-bit
addressing mode; and
- HEAP(,,ANYWHERE) is in effect; and
- the main routine is AMODE 31