STACK (CICS)
STACK controls the allocation of the thread's
stack storage. Typical items residing in the upward-growing stack are C or PL/I automatic variables,
COBOL LOCAL-STORAGE data items, and work areas for COBOL library routines.
Storage required for the common anchor area (CAA) and other control blocks is allocated
separately from, and prior to, the allocation of the initial stack segment and the initial
heap.
When COBOL is the only selected language, values for STACK will be changed to (64K,64K,ANY,KEEP,,).
STACK has the following suboptions :
- initial size (upward-growing) : the size of the initial upward-growing
stack segment, rounded up to the nearest 8 bytes of contiguous storage, maximum size of 16 MB with ANYWHERE or 1 MB with BELOW
- initial size units (upward-growing) : the units that initial size is specified in (K, M)
- increment size (upward-growing) : the minimum size of any subsequent
increment to the upward-growing stack area, rounded up to the nearest 8 bytes, maximum size of 16 MB with ANYWHERE or 1 MB with BELOW
- increment size units (upward-growing): the units that increment size is specified in (K, M)
- ANYWHERE or BELOW
ANYWHERE specifies that stack storage can be allocated anywhere in storage. If there is no storage available above the line, Language environment acquires storage below the line.
BELOW specifies that the stack 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 STACK increments is released when the last of
the storage in the stack is freed. The initial library stack segment is not
released until the enclave terminates.
KEEP specifies that storage allocated to STACK increments is not released when
the last of the storage in the stack is freed.
Notes :
- When an application is running in an XPLINK environment, the STACK run-time option will be forced to
STACK(,,ANYWHERE,,,). Only the ANYWHERE|BELOW option is changed by this action, to indicate that
stack storage can be allocated anywhere in storage. No message will be issued to indicate this
action.
- Applications running with ALL31(OFF) must specify STACK(,,BELOW,,,) to ensure that stack storage
is addressable by the application.
- PL/I consideration : PL/I automatic storage above the 16 MB line is supported under
control of the Language Environment STACK option. When the Language Environment stack is above,
PL/I temporaries (dummy arguments) and parameter lists (for reentrant/recursive blocks) also
reside above.
The stack frame size for an individual block is constrained
to 16 MB. Stack frame extensions are also constrained to 16 MB. Therefore, the size of an
automatic aggregate, temporary variable, or dummy argument cannot exceed 16 MB. Violation of
this constraint might have unpredictable results.
- The maximum initial and increment size for CICS above 16 MB is 1 gigabyte (1024 MB). This
restriction is subject to change from one release of CICS to another.
- z/OS UNIX System Services consideration : The STACK option specifies the
characteristics of the user stack for the initial thread. In particular, it gets the initial
size of the user stack for the initial thread.
The characteristics that indicate increment size, ANYWHERE, and KEEP or FREE apply to any thread
created using pthread_create. Language Environment gets the initial stack size from the thread's
attribute object specified in the pthread_create function. The default size to be set in the
thread's attribute object is obtained from the STACK run-time option's initial size.
The recommended default setting for STACK under z/OS UNIX is STACK(12K,12K,ANYWHERE,KEEP).