A method and system of carrying out garbage collection in a computer system.
Specifically,
the method and system utilize low contention grey object sets for concurrent marking
garbage collection. A garbage collector traces memory objects and identifies memory
objects according to a three-color abstraction, identifying a memory object with
a certain color if that memory object itself has been encountered by the garbage
collector, but some of the objects to which the memory object refers have not yet
been encountered. A packet manager organizes memory objects identified with the
certain color into packets, provides services to obtain empty or partially full
packets, and obtain full or partially full packets, and verifies whether a packet
of the certain color is being accessed by one of the threads of the garbage collector.