STACK64 (AMODE 64 only)

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).

Read syntax diagramSkip visual syntax diagramSTACK64S64 ( initial , increment , maximum )
Determines the size of the initial stack segment. The storage is contiguous. This value is specified as nM bytes of storage.
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.
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.

For more information

  • See RPTSTG for more information about the RPTSTG runtime option.
  • For more information about heap storage and heap storage tuning with storage report numbers, see Heap storage overview and Tuning heap storage in z/OS Language Environment Programming Guide.
  • For more information about using the storage reports generated by the RPTSTG runtime option to tune the stacks, see RPTSTG in z/OS Language Environment Programming Reference.