Patent ID: 6865585

Claim:
A method of performing garbage collection in a computer system having a shared memory and a plurality of processing units, wherein the memory is divided into heaps and each heap is associated with a single processing unit, said method comprising: stopping executing process threads; initiating parallel marking threads in each processing unit associated with a heap, wherein one thread executes within each processing unit and wherein the marking threads mark the reachable objects in the shared memory; upon completion of all marking threads, initiating parallel planning threads in each processing unit associated with a heap, wherein one thread executes within each processing unit and wherein each planning thread plans the new locations for objects within the associated heap; upon completion of all the planning threads, initiating parallel relocating threads in each processing unit associated with a heap, wherein one thread executes within each processing unit and wherein each relocating thread updates internal object references based on the new locations determined by the planning threads, the relocation threads updating information for objects within the associated heap; and upon completion of all the relocating threads, initiating parallel compacting threads in each processing unit associated with a heap, wherein one thread executes within each processing unit and wherein each compacting thread moves objects within the associated heap to the new locations determined by the planning threads.