1.

What Is generational garbage collection in context to Java? What makes it so popular?

Answer»

Generational garbage collection can simply be described as the garbage collector's approach of dividing the heap into a number of generations, each of which will HOLD objects based on their "age" on the heap. Marking is the initial stage in the waste collection process WHENEVER the garbage collector is turned on. The garbage collector uses this information to determine which memory blocks are in use and which are not. If all objects in a system must be scanned, this can be a lengthy operation.

As more objects are allocated, the list of objects grows longer and longer, causing garbage collection to take longer and longer. However, empirical application study has revealed that the majority of objects are transient. Objects are categorized according to their "age" in terms of how many garbage collection cycles they have SURVIVED with generational garbage collection. As a result, the majority of the effort was SPREAD out over several minor and major collection cycles.

Almost all garbage collectors today are multi-generational. This METHOD has become so popular because it has consistently proven to be the best option.



Discussion

No Comment Found