The standard GC is based on generational design, which exploits the behavior of Java applications where a large percentage of objects created by the application are short lived or temporary. The generational GC divides the object heap into two spaces (or generations), a new space and an old space. A new space is further divided into 2 equal spaces. Objects are allocated from one of the new spaces until an allocation failure occurs and scavenger cycle is triggered. In a scavenger cycle, only "used" objects are copied from one new space into another new space; some objects, which have been copied a number of times are promoted (moved) to old space. Since the new space is only a fraction of the entire heap, the scavenger cycle cause only a brief pause for the application. As objects are moved to the old space, it may become full and require a global collection (using mark-and-sweep) to free objects that have become dead. Since the old space is larger, global collection requires more time, but its less frequently to occur. GC also provides for a high degree of configuration and tuning, allowing for target-specific optimizations
|