Incremental Garbage Collection Part II Roland Schatz Incremental Garbage Collection – p.1/22
Baker – Disadvantages not concurrent Incremental Garbage Collection – p.2/22
Baker – Disadvantages not concurrent not even threadsafe Incremental Garbage Collection – p.2/22
Baker – Disadvantages not concurrent not even threadsafe expensive read trap Incremental Garbage Collection – p.2/22
Baker – Disadvantages not concurrent not even threadsafe expensive read trap requires hardware support Incremental Garbage Collection – p.2/22
Appel-Ellis-Li Collector no black ⇒ white pointers Incremental Garbage Collection – p.3/22
Appel-Ellis-Li Collector no black ⇒ white pointers Baker’s invariant Incremental Garbage Collection – p.3/22
Appel-Ellis-Li Collector no black ⇒ white pointers Baker’s invariant mutator never sees white pointers Incremental Garbage Collection – p.3/22
Appel-Ellis-Li Collector no black ⇒ white pointers Baker’s invariant mutator never sees white pointers intercept all pointer reads Incremental Garbage Collection – p.3/22
Appel-Ellis-Li Collector no black ⇒ white pointers Baker’s invariant mutator never sees white pointers intercept all pointer reads slightly stricter constraint Incremental Garbage Collection – p.3/22
Appel-Ellis-Li Collector no black ⇒ white pointers Baker’s invariant mutator never sees white pointers intercept all pointer reads slightly stricter constraint mutator only sees black objects Incremental Garbage Collection – p.3/22
Appel-Ellis-Li Collector no black ⇒ white pointers Baker’s invariant mutator never sees white pointers intercept all pointer reads slightly stricter constraint mutator only sees black objects use page protection hardware Incremental Garbage Collection – p.3/22
Memory Layout end new objects alloc free space unscanned potential unscanned objects garbage scanned scanned objects start fromspace tospace Incremental Garbage Collection – p.4/22
Page Protection black pages Incremental Garbage Collection – p.5/22
Page Protection black pages contain only tospace pointers Incremental Garbage Collection – p.5/22
Page Protection black pages contain only tospace pointers no problem Incremental Garbage Collection – p.5/22
Page Protection black pages contain only tospace pointers no problem white pages Incremental Garbage Collection – p.5/22
Page Protection black pages contain only tospace pointers no problem white pages mutator never sees white pointers Incremental Garbage Collection – p.5/22
Page Protection black pages contain only tospace pointers no problem white pages mutator never sees white pointers so we don’t care Incremental Garbage Collection – p.5/22
Page Protection gray pages Incremental Garbage Collection – p.6/22
Page Protection gray pages mutator may see gray pointers Incremental Garbage Collection – p.6/22
Page Protection gray pages mutator may see gray pointers mutator must not see gray objects Incremental Garbage Collection – p.6/22
Page Protection gray pages mutator may see gray pointers mutator must not see gray objects set to no access Incremental Garbage Collection – p.6/22
Handling Page Faults Tospace Read barrier Mutator before the trap Incremental Garbage Collection – p.7/22
Handling Page Faults Tospace Read barrier Mutator before the trap Incremental Garbage Collection – p.7/22
Handling Page Faults Tospace Tospace Read barrier Mutator before the trap after the trap Incremental Garbage Collection – p.7/22
Handling Page Faults Tospace Tospace Read barrier Mutator before the trap after the trap Incremental Garbage Collection – p.7/22
Summary advantages Incremental Garbage Collection – p.8/22
Summary advantages concurrent scanning possible Incremental Garbage Collection – p.8/22
Summary advantages concurrent scanning possible cheaper read trap Incremental Garbage Collection – p.8/22
Summary advantages concurrent scanning possible cheaper read trap problems Incremental Garbage Collection – p.8/22
Summary advantages concurrent scanning possible cheaper read trap problems relies on virtual memory Incremental Garbage Collection – p.8/22
Summary advantages concurrent scanning possible cheaper read trap problems relies on virtual memory global lock is bottleneck Incremental Garbage Collection – p.8/22
Summary advantages concurrent scanning possible cheaper read trap problems relies on virtual memory global lock is bottleneck flip is still stop-the-world Incremental Garbage Collection – p.8/22
Nettle’s Replicating Collector read barrier is still expensive Incremental Garbage Collection – p.9/22
Nettle’s Replicating Collector read barrier is still expensive use write barrier instead Incremental Garbage Collection – p.9/22
Nettle’s Replicating Collector Fromspace Tospace getHeader forward ptr header word read Mutator original write replica GC Incremental Garbage Collection – p.10/22
Nettle’s Replicating Collector Fromspace Tospace getHeader forward ptr header word read Mutator original write replica GC Mutation Log Incremental Garbage Collection – p.10/22
Huelsbergen-Laurus Collector distinguish mutable/immutable objects Incremental Garbage Collection – p.11/22
Huelsbergen-Laurus Collector distinguish mutable/immutable objects e.g. ML Incremental Garbage Collection – p.11/22
Huelsbergen-Laurus Collector distinguish mutable/immutable objects e.g. ML immutable objects Incremental Garbage Collection – p.11/22
Huelsbergen-Laurus Collector distinguish mutable/immutable objects e.g. ML immutable objects replicating collection Incremental Garbage Collection – p.11/22
Huelsbergen-Laurus Collector distinguish mutable/immutable objects e.g. ML immutable objects replicating collection mutable objects Incremental Garbage Collection – p.11/22
Huelsbergen-Laurus Collector distinguish mutable/immutable objects e.g. ML immutable objects replicating collection mutable objects classic copying collection Incremental Garbage Collection – p.11/22
Doligez-Leroy Collector Problem: heavy synchronization Incremental Garbage Collection – p.12/22
Doligez-Leroy Collector Problem: heavy synchronization seperate thread-local data Incremental Garbage Collection – p.12/22
Doligez-Leroy Collector Problem: heavy synchronization seperate thread-local data young generation Incremental Garbage Collection – p.12/22
Doligez-Leroy Collector Problem: heavy synchronization seperate thread-local data young generation thread-local Incremental Garbage Collection – p.12/22
Doligez-Leroy Collector Problem: heavy synchronization seperate thread-local data young generation thread-local immutable Incremental Garbage Collection – p.12/22
Doligez-Leroy Collector Problem: heavy synchronization seperate thread-local data young generation thread-local immutable old generation Incremental Garbage Collection – p.12/22
Doligez-Leroy Collector Problem: heavy synchronization seperate thread-local data young generation thread-local immutable old generation the rest Incremental Garbage Collection – p.12/22
Thread Local Heaps thread 1 thread 2 thread 3 young generation old generation Global variables Incremental Garbage Collection – p.13/22
In-Place Garbage Collection uncooperative environment Incremental Garbage Collection – p.14/22
In-Place Garbage Collection uncooperative environment relaxed consistency requirements Incremental Garbage Collection – p.14/22
In-Place Garbage Collection uncooperative environment relaxed consistency requirements Fragmentation! Incremental Garbage Collection – p.14/22
Four-Color Abstraction black: scanned Incremental Garbage Collection – p.15/22
Four-Color Abstraction black: scanned gray: marked, not scanned Incremental Garbage Collection – p.15/22
Four-Color Abstraction black: scanned gray: marked, not scanned white: not marked Incremental Garbage Collection – p.15/22
Four-Color Abstraction black: scanned gray: marked, not scanned white: not marked dead-white: free objects Incremental Garbage Collection – p.15/22
Four-Color Implementation end new objects alloc free space unscanned potential unscanned objects garbage scanned scanned objects start fromspace tospace Incremental Garbage Collection – p.16/22
Baker’s Treadmill scan Tospace new objects top Fromspace free list free bottom Incremental Garbage Collection – p.17/22
Baker’s Treadmill scan Tospace new objects top Fromspace free list free bottom Incremental Garbage Collection – p.17/22
Baker’s Treadmill scan Tospace new objects free list Fromspace top free bottom Incremental Garbage Collection – p.17/22
Recommend
More recommend