If you squint hard enough, this is an implementation of a higher order garbage collection: MarkNothingAndSweepEverything.
There, formalized the approach, so you can't call it terrible anymore.
There, formalized the approach, so you can't call it terrible anymore.
If you are looking for an apt metaphor, Stalin sort might be more in line with what's going on here. Or maybe "ostrich algorithm".
Some collectors may need to do this, but there are several collectors that don't. EpsilonGC is a prime example of a GC that doesen't need to prove anything
I mean, I interpret your comment to be a joke, but you could've made it a bit more obvious for people not familiar with the latest fancy in Java world.