A remembered set for a memory heap region in a garbage-collected computer
system is modified to classify reference locations stored therein by the
heap region from which the references originate so that the number of
references originating from a given region can be easily determined. If
the number of remembered set entries for references from a second region
to a first region reaches a predetermined threshold, the second region is
constrained so that it will be collected at the same time as, or before,
the first region. Then, all entries in the remembered set associated with
the first region for references from the second region to the first
region can be deleted, and no such entries need be entered in the future
thereby reducing the size of that remembered set and the time required to
scan it.