Derivation: THREAD level STACK storage
for AMODE 64
THREADSTACK64 controls the allocation of
the thread's stack storage for AMODE 64 applications, except for the
initial thread in a multithreaded environment.
The default
value for AMODE 64 applications is THREADSTACK64(OFF,1M,1M,128M).
Syntax
.-OFF-.
>>-+-THREADSTACK64-+--(--+-----+--,--initial--,--increment--,--->
'-TS64----------' '-ON--'
>--maximum--)--------------------------------------------------><
- OFF
- Indicates that the allocation suboptions of the STACK64 runtime
option are used for thread stack allocation. Any other suboption specified
with THREADSTACK64 is ignored.
- ON
- Controls the stack allocation for each thread, except the initial
thread, in a multithreaded environment.
- 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
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 multiple of 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 1 MB guard page is not included in any of the sizes.
- The maximum thread stack segment is the maximum of THREADSTACK64
initial and maximum sizes.
- The default value of 128 MB 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.