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.