After 3 months of coding weekends, my attempt to create a relocating nonblocking garbage collector in C++ has failed. It works in theory, but in practice the read barrier is pervasive and costly, and the threading invariants are incredibly tricky to maintain.
You can give each object an index, and maintain indexed reference counts per thread, so 4B * 32 threads = 128B per object overhead that must be scanned every GC cycle. That’s a lot of overhead though.
-
-
So you get to “card tables” as an alternative, storing a global table of 1B per region of memory (say 8B to 4KB) indicating that it contains pointers to be scanned. Then the GC memory overhead is bounded to 1/64.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.