Method and system for multiprocessor garbage collection
First Claim
1. A method of collecting garbage in a computer system having a memory and a plurality of multiprocessors that share the memory, the method comprising:
- logically dividing the memory into a plurality of heaps, each heap dedicated to one processor for garbage collection;
performing a plurality of garbage collection phases, wherein each processor having a dedicated heap, each processor performs each of the phases on the heap dedicated to the processor using a garbage collection thread executing on the processor; and
synchronizing the processors so that all processors have completed the preceding phase prior to each processor beginning the next phase.
1 Assignment
0 Petitions
Accused Products
Abstract
A garbage collection system and method in a multiprocessor environment having a shared memory wherein two or more processing units participate in the reclamation of garbage memory objects. The shared memory is divided into regions or heaps and all heaps are dedicated to one of the participating processing units. The processing units generally perform garbage collection operations, i.e., a thread on the heap or heaps that are dedicated to that the processing unit. However, the processing units are also allowed to access and modify other memory objects, in other heaps when those objects are referenced by and therefore may be traced back to memory objects within the processing units dedicated heap. The processors are synchronized at rendezvous points to prevent reclamation of used memory objects.
44 Citations
20 Claims
-
1. A method of collecting garbage in a computer system having a memory and a plurality of multiprocessors that share the memory, the method comprising:
-
logically dividing the memory into a plurality of heaps, each heap dedicated to one processor for garbage collection;
performing a plurality of garbage collection phases, wherein each processor having a dedicated heap, each processor performs each of the phases on the heap dedicated to the processor using a garbage collection thread executing on the processor; and
synchronizing the processors so that all processors have completed the preceding phase prior to each processor beginning the next phase. - View Dependent Claims (2, 3, 4)
-
-
5. 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 updates moves objects within the associated heap to the new locations determined by the planning threads. - View Dependent Claims (6, 7, 8, 9)
-
-
10. A system for performing garbage collection in a shared memory environment, the shared memory being accessed by a plurality of processing units, the shared memory divided into heaps and each heap is associated with one processing unit, the system comprising:
-
for each processing unit associated with a heap;
a marking module executing a marking phase that marks reachable objects within the shared memory;
a planning module for executing a planning phase that plans the relocation the memory objects within the associated heap following the marking of all reachable objects;
a relocating module for executing a relocating phase that updates the object references within objects of the associated heap following the planning of the relocation;
a compacting module for executing a compacting phase that moves the memory objects of the associated heap following the updating of the object references; and
a rendezvous module for determining whether all processing units in the system have completed each preceding phase before starting the next phase.
-
-
11. A computer program product readable by a computer and encoding instruction for executing a computer process for collecting garbage in a computer system having a memory and a plurality of multiprocessors that share the memory, the process comprising:
-
logically dividing the memory into a plurality of heaps, each heap dedicated to one processor for garbage collection;
performing a plurality of garbage collection phases, wherein each processor having a dedicated heap performs each of the phases using a garbage collection thread executing on the processor; and
synchronizing the processors so that each processor has completed the preceding phase prior to beginning the next phase. - View Dependent Claims (12, 13, 14)
-
-
15. A computer program product readable by a computer and encoding instruction for executing a computer process for 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 process 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 updates moves objects within the associated heap to the new locations determined by the planning threads. - View Dependent Claims (16, 17, 18, 19)
-
-
20. A runtime environment for a multiprocessor system, the multiprocessor system having a plurality of processing units and a shared memory, the shared memory divided into a plurality of heaps wherein each heap is dedicated to one processing unit;
- the runtime environment comprising;
a plurality of garbage collection modules for reclaiming unused memory objects located within the shared memory, each garbage collection module associated with a processing unit, each garbage collection module operates on a dedicated heap of memory; and
a synchronizing module for synchronizing the activities performed by the garbage collection modules.
- the runtime environment comprising;
Specification