Garbage Collectors in JVM

Throughput

The percentage of total time not spent in garbage collection, considered over long periods of time.

Garbage collection overhead

The inverse of throughput, that is, the percentage of total time spent in garbage collection.

Pause time

The length of time during which application execution is stopped while garbage collection is occurring.

Frequency of collection

How often collection occurs, relative to application execution.

Footprint

A measure of size, such as heap size.

Promptness

The time between when an object becomes garbage and when the memory becomes available.

Heap is divided into generations, mostly in two

  1. young objects
  2. old objects

Different collection algorithm can be used for different part (generation) of heap, and each algorithm can be optimized based on commonly observed characteristic of that particular generation.

weak-generation-hypothesis: most objects die young

Continue reading

Advertisements

java memory management

Overview of memory management
The Garbage Collector allocates areas of storage in the heap. These areas of storage define Java™ objects. When allocated, an object continues to be live while a reference (pointer) to it exists somewhere in the JVM; therefore the object is reachable. When an object ceases to be referenced from the active state, it becomes garbage and can be reclaimed for reuse. When this reclamation occurs, the Garbage Collector must process a possible finalizer and also ensure that any internal JVM resources that are associated with the object are returned to the pool of such resources.
Continue reading