Paper: A Fast Write Barrier for generational garbage collectors
Http://hoelzle.org/publications/write-barrier.pdf
The old age needs to record the reference to the new generation of objects, so that the new generation after the GC change the corresponding position of the old reference, or scan the entire old age. These tokens are called remembered Set. The mechanism that ensures that the reference location of the intergenerational is marked is called a write barrier or a store Check.
Generally using the card marking algorithm, the heap is divided into many card, each card2^k word (k=5,6,7), on 32 bits is generally 128,256, or 1024 bytes, each card a tag, Each store operation when the corresponding card object reference is changed, the card tag, in the recovery phase scan this card to change the reference to the latest. The tag that starts a card is a bit, but the performance is poor, changing the bit to 1 byte, even so, the extra overhead of memory is small.
The initial marking requires three SPARC commands:
St [%obj + offset],%ptr
Add%obj, offset,%tempsll%temp, K,%tempst %g0, [%byte_map +%temp]
In order to achieve the performance of the location of the object to find the same card, so that only two instructions, but the recovery requires multiple scanning:
St [%obj + offset],%ptr
SLL%obj, K,%tempst %g0, [%byte_map +%temp]
Marking accounted for the total write barrier time (also including the purge Phase scan card) 40%-100%, which accounted for 40% of the total GC overhead.
A fast write barrier algorithm for the generation of garbage collector