Patent ID: 7756912

Claim:
A method for minor garbage collection in a multitasking environment comprising: marking, by a processor, a plurality of cards as clean, wherein the plurality of cards designates ranges of memory locations in a shared older generation; marking, by the processor, a card selected from the plurality of cards as dirty when a reference field of an object within the card is modified, wherein a memory location of the reference field is designated by the card, wherein the reference field references a live young object in a task-specific young generation selected from a plurality of task-specific generations, and wherein the task-specific young generation is associated with a first task selected from a plurality of tasks; marking, by the processor, the card as single-dirty when the card only includes roots of live young objects in the task-specific young generation, wherein marking the card as single-dirty comprises recording a unique identifier associated with the first task, wherein the unique identifier is a byte comprising a plurality of possible values, and wherein the plurality of possible values is associated with dirty, clean, and the plurality of tasks; and optimizing, by the processor, task-specific minor garbage collection for a second task selected from the plurality of tasks by skipping the card when the card is marked as single-dirty.