Java Virtual Machine - Heap

Heap

The Java virtual machine heap is the area of memory used by the JVM, specifically HotSpot, for dynamic memory allocation. The heap is divided into generations:

  • The young generation stores short-lived objects that are created and immediately garbage collected.
  • Objects that persist longer are moved to the old generation (also called the tenured generation).
  • The permanent generation (or permgen) is used for class definitions and associated metadata.

Originally there was no permanent generation, and objects and classes were stored together in the same area. But as class unloading occurs much more rarely than objects are collected, moving class structures to a specific area allows significant performance improvements.

Read more about this topic:  Java Virtual Machine

Famous quotes containing the word heap:

    Now he saw by the heap of shavings still fresh at his feet, that, for him and for his work, the former lapse of time had been an illusion.
    Henry David Thoreau (1817–1862)

    It’s very expressive of myself. I just lump everything in a great heap which I have labeled “the past,” and, having thus emptied this deep reservoir that was once myself, I am ready to continue.
    Zelda Fitzgerald (1900–1948)

    In Africa I had indeed found a sufficiently frightful kind of loneliness but the isolation of this American ant heap was even more shattering.
    Louis-Ferdinand Céline (1894–1961)