News for hackers. Stuff that matters.
Re:Proposed New Go GC: Transaction-Oriented Collector by twotwotwo on Friday June 24, 2016 @01:52PM (#11971923)
"Transactions" here doesn't mean roll-back-able units like in a database, just small bits of code that terminate (and, the authors hope, leave some garbage behind that you can clean up without scanning a bunch of RAM). Request-oriented collector would have been about as good a name.

This is kind of a spin on generational collection, built around the observation that a lot of Go programs are HTTP/RPC/whatever servers.

Re:Proposed New Go GC: Transaction-Oriented Collector by jcrites on Friday June 24, 2016 @03:27PM (#11972698)
Yes, I've often considered that this is probably how Java's collector tends to behave in practice, particularly with the eden and young generation. If you're handling an RPC call that returns promptly, it's probable that all of the structures you've allocated on behalf of that call will be part of the young generation and can be efficiently collected.

Indeed, it's one reason why I've assumed that Rust's memory model might turn out to work well for services (not having had a chance to try it): there's a clear entry point where the request begins and ends, and all of the memory allocated from that point onward can be discretely tracked and freed upon completion. In the services that I've built, the majority of the allocations are for these short-lived objects, with a relatively smaller amount being related to long-lived objects like connections to other services or caches. I imagine that websites and services might behave like this, though I haven't studied it carefully.

I'll be interested to see how transaction-specific optimization turns out, and whether it can do better than a general purpose generational collector.

Re:Proposed New Go GC: Transaction-Oriented Collector by Jweb_Guru on Friday June 24, 2016 @02:06PM (#11972034)
It's also not exactly original to Go... the Ur language, for instance, employs a request-oriented collector (arguably, though the documentation claims it does not use garbage collection).
Re:Proposed New Go GC: Transaction-Oriented Collector by ezyang on Friday June 24, 2016 @03:01PM (#11972474)
Ur/Web uses region based memory management. Details are in http://adam.chlipala.net/papers/UrWebICFP15/ search for "memory management".
Re:Proposed New Go GC: Transaction-Oriented Collector by Jweb_Guru on Friday June 24, 2016 @04:19PM (#11973116)
Thanks for the link! I was actually at that talk :) To quote from the relevant slide:

* Transactions are integrated into Ur/Web at a deep level, so, whenever we run out of space, we can always abort the execution, allocate a larger heap, and restart.

* As a further optimization, we use region-based memory management, inferring a stack structure to allow freeing whole sets of objects at key points during execution.

Re:Proposed New Go GC: Transaction-Oriented Collector by _rlh on Tuesday June 28, 2016 @09:34AM (#11993629)
Not sure how to reach twotwotwo directly. I was hoping to get permission to rename the GC to ROC from TOC ("request" instead of "transaction"). It's simply a better name and the bird makes for better visuals on the slides. I'm Rick Hudson, rlh@, and can be emailed directly at golang.org.
Re:Proposed New Go GC: Transaction-Oriented Collector by pizlonator on Friday June 24, 2016 @06:26PM (#11973972)
Thanks for the clarification. It might work.