Talk:Tracing garbage collection
![]() | This article is rated C-class on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||||||||||||||||||||||||||||
|
Root set
[edit]The article always talks about a root set but does not explain which objects are considered living in the root set. Are this the Objects that are created in the first program routine like main
?
What about objects in the root set which reference other objects in the root set or can only objects that aren't referenced by other objects be a part of the root set? If so, how do you distinguish non reachable objects from root set objects?
--91.249.82.6 (talk) 18:15, 13 August 2019 (UTC)
- Second line of the first section: "A distinguished set of roots: objects that are assumed to be reachable. Typically, these include all the objects referenced from anywhere in the call stack (that is, all local variables and parameters in the functions currently being invoked), and any global variables." SKWJ (talk) 01:59, 14 August 2019 (UTC)
Tri-color marking example
[edit]The image example for the tri-color marking algorithm is needlessly confusing. The sets are already named after the colors white, grey and black, but the image uses the colors white, yellow and blue and then refers to boxes on the side to tell you which set they belong in, but the circles in the boxes aren't colored.
I'm not sure I'm the right person to change it, but I might give it a try if no one else swaps it with anything clearer. 2A02:A466:A997:0:8439:5BDC:C931:A5FC (talk) 17:00, 23 January 2024 (UTC)
Vandalism?
[edit]"Move each white object that o references to the grey set. This ensures that neither this object nor any object it references can be garbage-collected."
This doesn't make any sense.
2603:8001:A600:52:D78D:2BB9:E3EF:929E (talk) 03:51, 6 March 2025 (UTC)
- Yes it does: a gray set object will not be deleted (in the ongoing GC run), neither will black objects. Only white objects can be deleted at the end of the run.
- So, processing a gray object o, you can process every object that o references, but:
- - black objects have been saved and fully processed already so you don't have to do anything,
- - gray objects will be processed later, so no need to do anything with them, either,
- so only white objects that o references really need to be processed, and you do that by recolouring them to gray.
- At the end of this, every object that o referenced, was either already black/gray or was recolored to gray. Since gray objects never will be deleted, this really does 'ensure that this object [= o], nor any object it references [=the ones we recolored from white to gray, or those already gray/black] can be garbage collected'. Mvanderhallen (talk) 00:14, 15 March 2025 (UTC)
- And for completeness sake, even if you take 'this object' to refer to each object o', referenced by o and moved from white to gray, the statement still holds because this object o' now having become gray implies it won't be garbage collected, and also that it will be processed in the future meaning everything o' references will then be detected as reachable. Mvanderhallen (talk) 00:54, 15 March 2025 (UTC)
- C-Class Computer science articles
- Mid-importance Computer science articles
- WikiProject Computer science articles
- C-Class Computing articles
- Low-importance Computing articles
- C-Class software articles
- Low-importance software articles
- C-Class software articles of Low-importance
- All Software articles
- All Computing articles