[Mar 31] Fast Conservative Garbage Collection #305
Replies: 11 comments 9 replies
-
The authors explore a new space -- ambiguous roots + RC -- and find surprisingly good results. This is super neat, but I wonder if some empirical fact/trend in the benchmarks is quietly supporting these results. I think it would be super cool to figure out what this is, if any. Far from weakening these results, I think that finding this out would teach us something about the way we tend to write programs. For example, the generational hypothesis not only helps generational GC, but also reveals an emergent programming pattern. |
Beta Was this translation helpful? Give feedback.
-
This paper is also very long and contains lots of GC-specific terms and techniques, but I'm trying to grasp the main insight: combining RC with Conservative collector to implement a high performance conservative collector for managed languages. As naive conservative collector falls into tracing algorithms, this advanced GC is also a combination of tracing and RC, which was mentioned in Tuesday's Discussion. So I'm curious that if this method lies in the design space that we discussed on Tuesday? If it is, can we evaluate this high-performance GC using those metrics (time-space trade-off, ... etc). |
Beta Was this translation helpful? Give feedback.
-
I worry that I'm missing something fairly basic about conservative GC -- is the main reason to do it just that you don't need to reason about what happens to your pointers while you're transforming the code? I understand the point that if you're in a memory unsafe language you're forced to do conservative GC, but I'm wondering if there's more to the story. |
Beta Was this translation helpful? Give feedback.
-
I found it surprising that language designers would choose a conservative garbage collector purely for ease of implementation, but in hindsight this makes a lot of sense. The initial 1.0 release of Go used a simple conservative tracing garbage collector, which was eventually refined along with the rest of the language to the precise, concurrent, mark-sweep collector that is used today. I was also a bit surprised to see that one of the concerns with conservative garbage collection is speed. I expected conservative garbage collection to be a tradeoff between memory usage and performance, but it seems that conservative garbage collectors can perform significantly worse than precise collectors. My guess is this has to do with needing to trace extra paths of values that look like pointers but are actually integers, is that correct? |
Beta Was this translation helpful? Give feedback.
-
I found the object map proposal interesting, as in my understanding is what actually makes the conservative reference count possible. I understand that it is used in order to filter ambiguous references, but regarding its structure, it's not really clear to me if it's just a bitmap, or something more sophisticated. I am not sure that this is an accurate correlation, but bloom-filters are also backed-up by bitmaps, and support some kind of probabilistic filtering. If possible, would a bloom-filter work for filtering-out ambiguous references? Looks like there are some approaches that use bloom-filters in order to mark live objects: |
Beta Was this translation helpful? Give feedback.
-
One thing that really surprised me about this paper was just how important locality is! The performance difference between their collectors and BDW was attributed by the authors almost entirely to locality, and it was an 8% difference. I wonder if this could mean that it's possible for a collected language to beat a manually managed language? At least in C/C++ if you want to defrag your heap, you don't really have any options other than manually freeing and reallocating everything, which is kind of unrealistic. |
Beta Was this translation helpful? Give feedback.
-
I was found the division of the heap into blocks of data and specific lines an interesting strategy, which I understood to be one way to avoid wasting space while pinning objects. I was wondering if there was a reason the block size was chosen specifically at 32KB and the line size to be 256 Bytes. I was curious if in other works, the authors had tried other line sizes and found that a 256 byte line size was the best empirically on the chosen benchmarks. |
Beta Was this translation helpful? Give feedback.
-
This is a very long paper and has a lot of in-depth GC terms. Maybe I am not well versed in this topic so I am still a bit confused. I am sorry if this is a bad question. What’s the intuition here that makes conservative + RC a combination that stands out? In general, how do people pick their design for GC over a wide range of different technique and design choices? |
Beta Was this translation helpful? Give feedback.
-
I'm not sure if I lack some background knowledge, feeling like I sometimes get lost when reading this paper. Considering the performance and overhead of the proposed GC, I don't know what conservative GC is used for especially in the scenario of managed programming language. It seems like conservative GC is not as good as exact GCs. Are there any industrial PLs that use this kind of conservative GC? |
Beta Was this translation helpful? Give feedback.
-
One thing that I find interesting from this paper is how GC can affect the spatial locality of the program's data. Section 6.1 shows that the free-list collectors cause higher cache miss rate because it spreads objects in the address space instead of putting them contiguously. I think this is an important thing to keep in mind while implementing garbage collectors, that the layout of alive objects can affect the mutator's locality. |
Beta Was this translation helpful? Give feedback.
-
I’m not sure if I was just not understanding this paper that well, but I’m not totally understanding when conservative garbage collection would be favorable to exact GC? I did a quick search to see if there are any programming languages that use conservative garbage collection, and couldn’t find any. But then I stumbled across an implementation of the Boehm-Demers-Weiser (BDW) collector and its known clients. This list is surprisingly long, and some notable compilers include p4c and the Racket compiler. I’m curious as to why these compilers decided to use BDW rather than an exact garbage collector. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This is a thread for Fast Conservative Garbage Collection by Rifat Shahriyar, Stephen M. Blackburn, and Kathryn S. McKinley that we will be discussing in our last class before Spring Break 🌞
@5hubh4m and I (@ayakayorihiro ) will be leading the discussion, please post your thoughts and questions here!
Beta Was this translation helpful? Give feedback.
All reactions