How Language Environment-conforming languages uses stack and heap storage

Table 1. Usage of stack and heap storage by Language Environment-conforming languages
Language Stack Heap
C or C++
  • Automatic variables
  • Library routines
Variables allocated by:
  • malloc() function
  • calloc() function
  • realloc() function
  • Static external (RENT)
COBOL
  • Intrinsic functions
  • Library routines
  • LOCAL-STORAGE variables
  • WORKING-STORAGE variables
Fortran
  • Library routines
  • Dynamic common blocks
  • Variables allocated by ALLOCATE statement (VS Fortran Version 2 Release 6 only)
PL/I
  • Automatic variables
  • Library routines
  • BASED variables
  • CONTROLLED variables
  • AREA variables

Related runtime options

Table 2. Runtime options and functions
Runtime option Function
ANYHEAP Allocates library (HLL and Language Environment) heap storage above or below 16 MB
BELOWHEAP Allocates library heap storage below 16 MB
HEAP Allocates storage for user-controlled dynamically allocated variables
HEAPCHK Specifies that heap storage be inspected for damage.
HEAPPOOLS Improves the performance of heap storage allocation
HEAPZONES Provides a heap check zone for each storage request
LIBSTACK On non-CICS, used by library routine stack frames that must be below 16 MB
RPTSTG Generates a storage report
STACK Used by library routine stack frames that can reside anywhere in storage
STORAGE Controls the initial content and amount of storage reserved for the out-of-storage condition
THREADHEAP Controls the allocation and management of thread-level heap storage
THREADSTACK Controls the upward- and downward-growing stack allocation for each thread, except the initial thread, in a multithreaded environment

See z/OS Language Environment Programming Reference for syntax information.

Related callable services

Related callable services:
Table 3. Callable services options and functions
Callable service Function
CEECRHP Defines additional heaps
CEECZST Changes the size of a previously allocated heap element
CEEDSHP Discards an entire heap created with CEECRHP
CEEFRST Frees storage allocated by CEEGTST or an intrinsic language function
CEEGTST Gets storage from a heap whose ID you specify
CEE3RPH Sets the heading displayed at the top of the storage options report

See z/OS Language Environment Programming Reference for syntax information.