3 ms·
This is a super nice article with plenty of relevant talks and links. A HTTPS mirror: https://outline.com/K96Geb https://outline.com/K96Geb A presentation on S
by ignoramous 8y ago
This is a super nice article with plenty of relevant talks and links. A HTTPS mirror: https://outline.com/K96Geb https://outline.com/K96Geb
A presentation on Shenandoah by one of the principal developers (focuses on the how): https://youtube.com/watch?v=4d9-FQZZoVA https://youtube.com/watch?v=4d9-FQZZoVA
Another presentation (focuses on the how, why, and when) at devoxx: https://www.youtube.com/watch?v=VCeHkcwfF9Q https://www.youtube.com/watch?v=VCeHkcwfF9Q
Tangent: Go GC (generational, non-copying, concurrent mark and concurrent sweep) and the improvements it saw from 1.5 -> 1.8 https://blog.golang.org/ismmkeynote https://blog.golang.org/ismmkeynote
The mutator/pacer scheme, the tri-color mark scheme, using rw-barriers during the sweep phase are interesting to contrast between the two GCs.
- ngrilly 8y ago> Tangent: Go GC (generational, non-copying, concurrent mark and concurrent sweep) I think that Go GC is not generational. If I'm not mistaken, the keynote you linked explains they tried it and the gain were not there.
- johncolanduoni 8y agoThey tried it without going as far as bump-pointer allocation in the nursery, so I wouldn’t say that Go’s GC journey away from generational was due to measuring it and it not working. I don’t think anyone has high expectations for the performance of non-copying generational GC. IIRC the presentation just said they weren’t willing to try copying because they didn’t think it would be possible to maintain good latency. Which I think Azul and perhaps a future evolution of the new JVM collectors would have something the say about.
- geodel 8y ago> Which I think Azul and perhaps a future evolution of the new JVM collectors would have something the say about. That something is much higher memory requirement for same size workload as compared to Go.
- munificent 8y agoThis makes sense for Go. A big part of the reason the generational hypothesis is true for most applications is that they allocate short-lived objects inside function bodies that are no longer needed when the function returns. In Go, most of those objects actually do get allocated directly on the stack, or as fields directly inside other objects. So they are never seen by the GC. This is one of the aspects of the language design that I really admire. Or, you could look at as saying that Go does have a generational memory manager, and the first generation is "on the stack".
- apta 8y ago> In Go, most of those objects actually do get allocated directly on the stack, or as fields directly inside other objects. Most golang code I've seen still relies on pointers to objects, so unless escape analysis is better than say what the JVM or .NET offer, it's not really that different from them. .NET already has value types, and the JVM should be getting them soonish. So there really isn't that much difference from this aspect.
- CamouflagedKiwi 8y agoThere is a vast difference in this aspect; a []SomeStruct makes two allocations (one for the control structures, one for the data), which might be on the stack or not. Conversely an ArrayList<SomeClass> makes a linear number of allocations; each object in it is separately allocated. As you say, value types are coming soon, but they don't exist now, so right now there is a lot of difference (and in practice will be for a long time, because not everything is going to migrate to value types immediately).
- geodel 8y agoAnd even after value types arrive it will be years before library ecosystem leverage that. Typical Java projects use dozens of 3rd party libraries and they are not going to see much effect in next 5 years.
- 8y ago
- kardianos 8y agoGo's GC is not currently generational. As others have mentioned, Go gives you more control over memory which helps considerably. If you want to know more about the current progress, there is a great presentation -> blog here: https://blog.golang.org/ismmkeynote https://blog.golang.org/ismmkeynote And you can see the most recent generational GC code here: https://go-review.googlesource.com/c/go/+/137482 https://go-review.googlesource.com/c/go/+/137482 Though my guess is it won't get merged into mainline for Go1.13 as it is already in code freeze.
- bradleyjg 8y ago> A HTTPS mirror: Why?
- ignoramous 8y agoOne of several reasons: ISPs meddle with content. https://www.infoworld.com/article/2925839/code-injection-new-low-isps.html https://www.infoworld.com/article/2925839/code-injection-new...
- bradleyjg 8y agoKind of ironic that an article complaining about ISP practices served me an uncloseable scam ad. Mote, beam and all that.
- greglindahl 8y agoI have adblock and I don't see an ad. Most people commenting at HN use adblock. It's a pretty good illustration of why you might want to prevent 3rd parties from fucking with the content you view without your permission, while also using adblock to fuck with the content you view with your permission.