Answer»
- Generational garbage collection can be loosely defined as the STRATEGY used by the garbage collector where the heap is DIVIDED into a number of sections called generations, each of which will hold objects according to their “age” on the heap.
- Whenever the garbage collector is running, the first step in the process is called marking. This is where the garbage collector identifies which pieces of memory are in use and which are not. This can be a very time-consuming process if all objects in a system must be scanned.
- As more and more objects are ALLOCATED, the list of objects grows and grows leading to longer and longer garbage collection time. However, empirical analysis of applications has SHOWN that most objects are short-lived.
- With generational garbage collection, objects are grouped according to their “age” in terms of how many garbage collection cycles they have survived. This way, the bulk of the work spread across various minor and major collection cycles.
- Today, almost all garbage collectors are generational. This strategy is so POPULAR because, over time, it has proven to be the optimal solution.
|