Garbage Collector has to decide Cleaning Process on Heap, based upon the lifetime of objects. GC Categorizes the LifeTime with Generations,
Generation 0:Short Lived Objects.(Temp Variables)
Generation 1:Medium Lived Objects
Generation 2:Long Lived Objects.(static variables)
Generation 0 and 1 Are called Ephemeral(Short Lived) Segments.
Every Objects start their cycle with Generation 0,Upon Garbage Collection,if they survive the Clean,then these objects are moved to next generation.