Objects and Heap
When the JVM starts, memory is allocated for the heap.
heap¶
A region of the JVM in which memory for new objects is allocated.
As we create objects, the heap fills up.

The heap may grow, but when it becomes full, objects that are no longer used are cleared, making space for new objects.
This process is called garbage collection.
Practice Exercise¶
Oracle's JVM sets defaults for minimum and maximum heap size, based on the type of machine. You can override these with the
-Xmsand-Xmxcommands.