z/OS Language Environment Concepts Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Heap storage

z/OS Language Environment Concepts Guide
SA38-0687-00

Heap storage can be allocated and freed in no particular order. (Stack storage, in contrast, is allocated when a routine is entered and freed when the routines ends.) Language Environment provides multiple heaps that may be dynamically created and discarded by using Language Environment callable services. Language Environment's heap storage is reliable because it provides a level of isolation and prevents common errors such as attempting to free a heap element that has already been freed.

Heap storage is shared among all program units and all threads in an enclave. Allocated heap storage remains allocated until it is explicitly freed by a thread or until the enclave terminates. Heap storage is typically controlled by the programmer through Language Environment runtime options and callable services.

Heap storage consists of an initial heap segment that is allocated when the first heap element is allocated by a call to CEEGTST. The Language Environment storage manager allocates heap increments as previously allocated segments become full.

Figure 1 illustrates heap storage.

Figure 1. Language Environment heap storage
Heap storage consists of of an initial heap segment that is allocated when the first heap element is allocated by a call to CEEGTST. It is shared among all program units and all threads in an enclave.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014