Patent ID: 8589456

Claim:
A method for garbage collection, comprising: dividing a heap space for at least one program executing on at least one processing unit into a plurality of regions, the heap space stored in at least one memory, the plurality of regions including: a plurality of Young regions each operable to store at least one Young object, a plurality of Old regions each operable to store at least one Old object, and a plurality of Humongous regions each operable to store no more than one object; maintaining a remembered set in the at least one memory for each region of the plurality of regions that specifies where there are references from outside the respective region to inside the respective region; creating a garbage collection list in the at least one memory specifying regions of the plurality of regions to perform a garbage collection on, comprising: including the plurality of Young regions in the garbage collection list; selecting at least one Humongous region of the plurality of Humongous regions to include in the garbage collection list by: selecting a fixed number of Humongous regions of the plurality of Humongous regions; selecting at least one Humongous region of the plurality of Humongous regions that has fewest references specified in its remembered set until the fixed number of Humongous regions has been selected; indicating in a selected Humongous region list Humongous regions of the plurality of Humongous regions that have previously been selected for inclusion in at least one previous garbage collection list; selecting the fixed number of Humongous regions from Humongous regions of the plurality of Humongous regions that are not indicated in the selected Humongous region list; updating the selected Humongous region list based on the selected fixed number of Humongous regions; and if all Humongous regions of the plurality of Humongous regions are indicated in the selected Humongous region list, clearing the selected Humongous region list; determining whether to select at least one Old region to include in the garbage collection list; and when it is determined to select at least one Old region, selecting the at least one Old region and including the selected at least one Old region in the garbage collection list; and utilizing the at least one processing unit, performing the garbage collection on the regions specified in the garbage collection list by utilizing at least the remembered set for each respective region to determine if reachable objects are stored in the respective region; and performing a marking cycle, upon the occurrence of a triggering event by: marking objects that are reachable; and calculating a liveness percentage for each Old region of the plurality of Old regions based on the marked objects.