> tracing garbage collection is a form of automatic memory management that consists of determining which objects should be deallocated ("garbage collected") by tracing which objects are reachable by a chain of references from certain "root" objects, and considering the rest as "garbage" and collecting them
So it starts at the root and, in a sense, "iterates" down through the reference tree to see which allocations are reachable, and then the inverse of that is freed. In the OP case, by contrast, "which allocations to free" is known at "collection" time, but there's still an extra step of actually doing the collection.