Patent ID: 7779054

Claim:
A computer-implemented method, comprising: using a computer to perform: allocating memory to objects within one or more regions of a heap partitioned into a plurality of regions; classifying each region of the one or more regions as belonging to a category of regions of a plurality of categories, based at least in part on a recency of allocation of an object within the region; determining whether regions belonging to a first category of the plurality of categories are to be excluded from a collection set of one or more regions from which memory is to be reclaimed during a particular garbage collection interval on the heap, wherein said determining is based on an efficiency metric of garbage collection during a garbage collection interval on the heap, wherein the efficiency metric is calculated based upon an amount of memory reclaimed during a previous garbage collection interval having a collection set including a region belonging to the first category; and in response to determining that the collection set is to exclude regions belonging to the first category, reclaiming memory from one or more regions that do not belong to the first category during the particular garbage collection interval.