Patent ID: 7640544

Claim:
A method employing execution threads to perform garbage-collection work tasks for a heap memory the method includes: determining root references for the garbage-collection work tasks; dividing tasks of identifying objects referenced by the root references into task groups; assigning the task groups to the execution threads; providing a work queue for each thread of the execution threads, each work queue having first and second ends; executing the execution threads to perform the task groups by using a plurality of processors, wherein executing an execution thread comprises: pushing onto the first end of the execution thread's work queue an identifier of a first one of the garbage-collection work tasks identified by the execution thread; popping an identifier of a second one of the garbage-collection work tasks from the first end of the execution thread's work queue and performing the second one of the garbage-collection work tasks; and when the execution thread's work queue is empty, popping an identifier of a third one of the garbage-collection work tasks from another queue's second end and performing the third one of the garbage-collection work tasks.