The write barrier solution puts the black objects behind a write barrier. The collector proceeds by scanning grey objects for pointers to white objects. The white objects found are turned grey, and the grey objects scanned are turned black. When there are no more grey objects, the collection is complete and all the white objects can be recycled. In generational garbage collection, this technique is used for references from an older generation to a younger one.
More complicated schemes are also possible.
For example, all objects allocated on a particular page might be the same size, or the same type. This technique can be used to avoided allocating object header bits or header tags. If the reference count ever falls to zero, then it is known that there are no pointers to the object, and it may be reclaimed. In a multi-threaded system, if threads are preemptively scheduled, reference counting requires additional care to ensure that the updates to reference counts are atomic. Copying Copying collection attempts to collect memory by removing all active memory from a storage arena, and then reusing the arena.