The Garbage Collection Handbook: The Art of Automatic Memory Management (2nd Ed)
59 points
3 hours ago
| 4 comments
| gchandbook.org
| HN
pdevr
57 minutes ago
[-]
I had the 2012 print edition. One of the best books available - the best book that I knew - about GC at that time.

Anti-pattern: Regarding the 2023 e-book edition, I do not see a way to buy it from the site, or even a link to buy.

reply
Jtsummers
28 minutes ago
[-]
I thought I was missing something but figured they just didn't have a link to purchase it. I ended up going to the publishers site to track it down:

https://www.routledge.com/The-Garbage-Collection-Handbook-Th...

reply
hamstergene
1 hour ago
[-]
What I didn’t like about this series of books was choosing “garbage collection” as umbrella term for both tracing GC and reference counting, without verifying if programming community would agree with that, which turned out they didn’t.

I’ve seen a lot of threads here and on reddit where people were arguing about terminology purely because of this book alone.

By that definition, C++ code has garbage collection if it uses std::shared_ptr, going against widespread common usage of the term “garbage collected programming language” which specifically contrasts manual languages like C++ or Rust against garbage collected ones.

“Automatic Memory Management” is a lot more suitable description to what programmers have to do to manage memory; it is now in the title but still hasn’t become the primary term.

reply
pron
36 minutes ago
[-]
> What I didn’t like about this series of books was choosing “garbage collection” as umbrella term for both tracing GC and reference counting, without verifying if programming community would agree with that, which turned out they didn’t.

This has been the standard terminology in memory management research for many decades. The only programmers who don't like it are those who don't understand the principles of memory management.

> By that definition, C++ code has garbage collection if it uses std::shared_ptr

That's right.

> going against widespread common usage of the term “garbage collected programming language” which specifically contrasts manual languages like C++ or Rust against garbage collected ones.

Since this contrast mostly exists in the minds of people who don't understand memory management, going against this common misconception is good. That's not to say that there aren't some interesting tradeoffs that often align with the colloquial perception, "garbage collection" isn't the interesting part. As you said, both C++ and Rust use GC; in fact, they use a GC somewhat similar to the one used by CPython.

reply
trumpdong
1 hour ago
[-]
The Linux kernel has garbage collection, and not just the controversial refcount kind.
reply
rayiner
1 hour ago
[-]
How good are AIs at coding manual memory management? Is this a sea change in automatic memory management?
reply
mtklein
56 minutes ago
[-]
I have never seen Codex or Claude get manual memory management wrong. I used to be pretty fastidious about using leak sanitizer or other such tools to catch my own memory management issues, and while not quite useless, that sort of testing has dropped way down my list of worries the more I lean on LLMs. I am constantly surprised by how many formerly tedious or error prone tasks stopped being either of those, and I expect to see practice shift away from middle-safe languages like C++ to not just much more safe languages like Rust but surprisingly also to much less safe ones like C and platform specific assembly.
reply
orionblastar
3 hours ago
[-]
I remember reading it before. My son threw it away when we moved houses, not knowing how important it was. I'd recommend it.
reply
tikhonj
2 hours ago
[-]
Ironic that this of all books got garbage collected prematurely.
reply
travisgriggs
2 hours ago
[-]
Q: what kind of collection is this real world example illustrating?

A: Copying Garbage Collector (semi space). Chapter 4!

Great book. I was always fascinated by bakers treadmill. Always wanted a real world case where I could implement one with Fibonacci sized mills.

reply