how the live objects are figured out in young generation collection?

前端 未结 3 1850
广开言路
广开言路 2021-02-06 04:54

I understand that time taken by YGC is proportional to number of live objects in Eden. I also understand that how the live objects are figured out in Major collections (All the

3条回答
  •  清酒与你
    2021-02-06 05:45

    I am quoting the relevant text from the article by Brian Goetz here.

    Tracing garbage collectors, such as copying, mark-sweep, and mark-compact, all start scanning from the root set, traversing references between objects, until all live objects have been visited. A generational tracing collector starts from the root set, but does not traverse references that lead to objects in the older generation, which reduces the size of the object graph to be traced.

提交回复
热议问题