Patent ID: 7539837

Claim:
A method for reducing remembered set overhead in a generational garbage collector by constraining collection set choice, the method comprising: (a) modifying a remembered set for a first heap region to classify reference locations stored as entries therein by heap regions from which the references originate and to maintain a count of remembered set entries originating from each heap region; (b) if the number of remembered set entries for references from a second region to the first region reaches a predetermined threshold, constraining the second heap region so that it will be collected at the same time as, or before, the first region; (c) when the second heap region is constrained, deleting all entries in the first region remembered set for references from the second region to the first region; maintaining a count of the total number of entries in a region contained in the remembered sets of all other regions; and when the count exceeds a predetermined count, removing any constraint between the region and the other regions and causing the remembered sets for the constrained regions to be recreated.