Skip to main content
Heap
- JVM has a heap area, which is shared across all the JVM threads.
- Heap is used to dynamically allocate memory for the class objects and arrays.
- Memory allocated by the obejcts is reclaimed by the Garbage Collector.
- Garbage Collector technique is not fixex, It is getting decided based on the requirements of the System implemantation.
- The heap area can be of fixed size, or it can be enlarged based on the computation.
- The heap memory area is not required to be contiguous.
- If required heap memory cannot be made available by the automatic storage management of JVM then JVM will give you OutOfMemoryError.