
792 • Java Programming
The Garbage Collected Heap
The technique through which a program can obtain space
in the RAM during the execution of the program and not
during compilation is called dynamic memory allocation. In
this method, space for the variables (array, strings, etc.) is
allocated from a free memory region which is known as heap.
This area is not fi xed in nature and keeps changing as the
memory is allocated and de-allocated from this region. The
entire runtime view of memory for a program is shown in
Figure 24.5.
The heap is often assigned a large, fi xed sized when the
Java runtime system is started, but on systems that support ...