STACK64
controls the allocation of the thread's stack storage for AMODE 64
applications. 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.
The
default value for AMODE 64 applications is STACK64(1M,1M,128M).
Syntax
>>-+-STACK64-+--(--+---------+--,--+-----------+--,------------->
'-S64-----' '-initial-' '-increment-'
>--+---------+--)----------------------------------------------><
'-maximum-'
- initial
- Determines the size of the initial stack segment. The storage
is contiguous. This value is specified as nM
bytes of storage.
- increment
- Determines the minimum size of any subsequent increment to the
downward-growing stack area. This value is specified as nM
bytes of storage. The actual amount of allocated storage is the larger
of two values— increment or the requested
size—rounded up to the nearest 1MB. If you specify increment as
0, only the amount of the storage needed at the time of the request,
rounded up to the nearest multiple of 1MB, is obtained. The requested
size is the amount of storage a routine needs for a stack frame.
- maximum
- Specifies the maximum stack size. This value is specified as nM
bytes of storage. When the maximum size is less than the initial size, initial is
used as the maximum stack size.
Usage notes
- The 1MB guard page is not included in any of the sizes.
- The maximum stack segment is the maximum of STACK64 initial and
maximum sizes.
- The default value of 128MB for the maximum stack size of the STACK64
and THREADSTACK64 runtime options can cause excessive use of system
resources (such as real storage) when running a multithreaded application
that creates many pthreads. For such applications, it is recommended
to use the Language Environment® Storage Report (RPTSTG runtime option) to determine
your application's actual pthread stack storage usage, and then use
the THREADSTACK64 runtime option to set the maximum stack size to
a value closer to the actual usage.
Performance consideration
You can improve
performance with the STACK64 runtime option by
specifying values that minimize the number of times the operating
system allocates storage. See RPTSTG for
information about how to generate a report you can use to determine
the optimum values for the STACK64 runtime option.