Friday, April 1, 2016

Garbage Collection: Java

Garbage Collection:
Has following steps:
1.Marking: Marking live and dead Objects.
2.Normal deletion and Compact Deletion
  Since many Objects live for shorter time;
 thus, Generational GC
 Young: called minor collection
 Old:called major collection, objects move to Old geneartion for young geneartion after a threshold time elapses.
 Permanent:Conatins meta dta needed for classes from JVM or libraries gets collected under full garbage collection

When Objects are created they are moved to EDEN space, one first MINOR GC moves to survival space1.Same is repeated for second MINOR GC and the objects that survives are promoted from
YOUNG generation to OLD , after they crosses the age threshold.

ConcurrentMarkSweep is the collector in latest java, here garbage collection is done without moving the live Objects

No comments:

Post a Comment