Replies: 9 comments 31 replies
-
I have done most of my coding in Java, and so the extent that I knew about garbage collection prior to the lesson and this paper was that Java automatically takes care of it for me and that I didn't have to worry about it. Learning about the different garbage collection methods was really interesting at a high level even though the details of some of the algorithms in the paper were a bit confusing for me. After learning this, I did have a general question about garbage collection. In languages like C/C++ there is no automatic garbage collection like in Java, but it is rather up to the user to prevent memory leaks. Is there a particular reason / situation where this would be preferable over Java's automatic garbage collection? Is there a situation in which we would actually want to manually alloc / free memory rather than have it all be done behind the scenes for us? This is a little off topic to the paper, but it was something that I was curious about while reading. Something that came to mind initially is if we were dealing with a real time operating system, in which case having deterministic behavior from manual memory management is potentially better than an automatic garbage collector where we don't know the specifics of how it is being performed. Besides this, are there any other big reasons? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
-
This paper reminded me of a systems paper I read (On the Duality of Operating System Structure) that compared shared variable based concurrent processes with message passing systems. The paper introduced the idea that two styles are duals of each other, despite being treated as vastly different approaches by the community. So often research feels like incremental improvements to the same approach, it is satisfying to see a paper that takes a new fundamental look at the problem, offering some insight that the community was lacking before - or perhaps just a new perspective. I was especially intrigued by the conclusion that as each garbage collection approach gets optimized, they take on more characteristics of each other. Despite the (occasionally) heinous number of definitions in the paper, I liked the formalisms they introduced allowing the “fair” comparison of seemingly different gc approaches, essentially laying the groundwork for the community to formally study and compare them in the future. |
Beta Was this translation helpful? Give feedback.
-
The paper writes that their methodology "may help enable the dynamic construction of garbage collection algorithms." I wonder if there's been work that uses this methodology to automatically generate garbage collectors given a program at runtime, or less ambitiously, given program characteristic parameters. |
Beta Was this translation helpful? Give feedback.
-
Interesting paper! I'm not super familiar with optimization theory, but I think I would've liked to see a bit more rigor in the claim that the two problems are duals. While it was interesting to see a qualitative comparison of the two approaches, and the analogy of "matter" versus "anti-matter" was also very useful, I think most theorists would liked to see a bit more mathematical certainty. That being said, I liked the space/time analyses of the different collectors. I particularly enjoyed the discussion on the unified approach to garbage collection (e.g. taking tips from both approaches is bound to work better than purely implementing one or the other). I especially found it interesting in the context of the Train Algorithm. The algorithm has incremental collection (similar to reference counting) which allows it to achieve short pause times. Further, the algorithm is able to handle long-lived references because it is structured around moving, inter-car references. Even though it's not the primary method used for garbage collection today, I think it does a pretty good job of highlighting the fact that modern garbage collectors need both tracing and reference counting aspects to outperform what our current capabilities are. This paper also made me think about what other problems in compilers are duals of each other. This made me think of problems like register allocation and register spilling which also can be viewed as duals. A lot of the problems in compilers are NP-Hard or worse, so thinking about it from an optimization theory perspective could introduce novel insights into how to better solve these problems. |
Beta Was this translation helpful? Give feedback.
-
Reading this paper made me wish reference counting and tracing were always introduced as duals! It is a pretty idea. |
Beta Was this translation helpful? Give feedback.
-
The theory presented in the paper, and the cookie-cutter-ish style of the way the algorithms were presented seemed reminiscent of dataflow analysis. It seems possible that a language could have a really customizable garbage collector that allows users to specify things like write barriers, recurse conditions, tracing start points, etc. to tailor a GC towards optimizing the things the user cares most about. The Dataflow analysis analogy also made me wonder if there was a similar paper that took a bunch of existing analyses and discovered a similar relationship or if analyses kind of started out as being part of a unified framework. |
Beta Was this translation helpful? Give feedback.
-
I think it's really interesting that the two views of garbage collection presented in class actually converge to similar results as presented in the paper. However, this actually isn't too surprising considering when considering optimizations like delayed reference counting, which makes RC extremely similar to Tracing GCs in the context of "stopping the world" to perform GC. I wonder it could be viable to write compilers that are able to statically analyze the code (via some heuristic) or runtimes that can dynamically balance tradeoffs of tracing/rc collectors via different parameterizations of the hybrid model presented in the paper. Could this make GC'd languages more viable in embedded systems applications? |
Beta Was this translation helpful? Give feedback.
-
To be honest, I found this paper and the way it presented its ideas a bit dry. I thought it was compelling up to and including the point where it discusses how tracing computes the least fixed point of the "garbage" function, and reference counting computes the "greatest," but after that it seems the paper became more of a survey on different garbage collection techniques. Indeed, there were references to how the "macro-nodes" in generational & multi-heap garbage collectors are reference-counted, but these later arguments felt more philosophical than grounded. More generally, I don't believe statements like the following make a very well-established argument:
Maybe it's that I just don't find the duality of tracing and reference counting a particularly enthralling problem in of itself, but I also think that this duality could've led to deeper insights if it was further formalized as @vivianyyd discussed. In the end, I'm not sure how much of this intuitive "duality" bought in terms of results for the paper. |
Beta Was this translation helpful? Give feedback.
-
Hey, everyone,
This is the discussion thread for the Unified Theory of Garbage Collection discussion on Tuesday, October 24. The paper is here!
Please post your thoughts, comments, and questions below before the discussion.
Beta Was this translation helpful? Give feedback.
All reactions