A garbage collector that employs the train algorithm to manage a
generation in a computer system's dynamically allocated heap maintains
for each of the generation's cars a respective remembered set that
identifies all locations where references to objects in that car have
been found by scanning locations identified by the mutator as having been
modified. To avoid some of the expense of remembered-set updating, the
collector refrains from attempting to add to a remembered set any
reference located in a car that will be collected during the next
collection increment. Additionally, if no mutator operation will occur
before a collection set of one or more cars will be collected, any
reference located outside that collection set but referring to an object
within the collection set is not recorded in a remembered set but is
recorded instead in a scratch-pad list of entries that identify
references to collection-set objects that need to be evacuated.