Patent ID: 7293051

Claim:
A computer system comprising a memory with a heap and instructions stored on a computer readable storage medium configured to execute a mutator and a garbage collector, wherein the garbage collector is configured to: A) collect at least a portion of the heap in collection increments, in each of at least some of which the garbage collector collects a respective collection set that results from a respective collection-set-selection operation in which the garbage collector selects at least part of the collection set from among a plurality of heap regions into which the garbage collector treats at least that portion of the heap as divided; B) perform general efficiency-metric computations, in each of at least some of which the garbage collector computes a respective original efficiency metric representing a relative collection efficiency for every heap region in a relatively large plurality of the heap regions; C) perform, between each of at least some pairs of consecutive ones of the general efficiency-metric computations, a plurality of the collection increments, for each of a plurality of which: i) the garbage collector performs a subset-selection operation, in which the garbage collector selects, from among the relatively large plurality of heap regions for which the garbage collector computed original efficiency metrics in the most recent of the general efficiency-metric computations, a relatively small heap-region subset in accordance with the original efficiency metrics thereby computed; ii) the garbage collector performs a re-computation of the efficiency metrics for only that heap-region subset; and iii) the collection-set-selection operation includes a metric-based collection-set-selection operation, in which the garbage collector selects a part of the collection set from the heap-region subset in accordance with the efficiency metrics recomputed in that re-computation; and D) reclaim the part of the collection set selected from the heap-region subset for reuse by the computer system.