Semua buku

Profesional

Aplikasi Tentang Pelatih Masuk Mulai membaca

Computer Science · Glosarium

Apa itu Generational collection, write barrier, remembered set?

Dikenal juga sebagai: generational collection · remembered set · write barrier

Definition 9.9 University Computer Science — Year 3 · Bab 9 — Memory Management and Garbage Collection

A generational collector allocates in a small nursery and collects it alone in a minor collection, which moves its survivors into an old generation (promotion); a major collection collects the whole heap. The remembered set holds the old objects that may refer to nursery objects; a minor collection treats them as roots. A write barrier is code run at every store of a reference into an object; here, it adds the object to the remembered set when an old object receives a reference to a young one.

Two generations. The store of a reference to the young cell y into the old cell s goes through the write barrier, which adds s to the remembered set. The next minor collection starts from the roots and from s, so it promotes y; the grey cell, which nothing refers to, is never examined.
Two generations. The store of a reference to the young cell yy into the old cell ss goes through the write barrier, which adds ss to the remembered set. The next minor collection starts from the roots and from ss, so it promotes yy; the grey cell, which nothing refers to, is never examined.
Baca dalam konteks →