In a garbage collector that more efficiently places newly promoted objects
into a generation managed by the train algorithm, a promotion train is
established near the oldest train and the objects are placed therein. If
some objects are referenced from existing trains in the generation those
objects are placed into those trains, and if any such objects are
referenced from several existing trains, the objects are placed at the
end of the youngest referencing train. The promotion train may be a new
train that is placed, or a existing train that is selected, between the
oldest train and the youngest train at a position based on the amount of
memory compared to the size of a collection set. In the case of multiple
collector threads, multiple cars in a promotion train or multiple
promotion trains may be formed.