1

A friend is writing a book in a non-English language and has trouble translating garbage collection (GC). On the other hand, automatic memory management (AMM) translates very well.

The Wikipedia article on GC states that GC is a form of AMM. The same article also states that reference counting (RC) is a form of garbage collection. So, it would appear that we have AMM as a superset of GC, and GC as a superset of RC. However, there are many informal texts which use GC and AMM interchangeably. It therefore appears that one could safely say that AMM (also known as GC) has been realized either by identifying (un)reachable objects by tracing pointers or by relying on reference counts.

My question is: is there any AMM technique which could not be classified as GC? Or, equivalently, is the distinction between GC and AMM justified?

Please, feel free to comment on my wild guesses on AMM (GC) taxonomy :-)

3
  • How about just leaving "garbage collection" untranslated? That's what I and almost everyone I've met do when talking about it in my native language. It's standard terminology after all. Commented Jan 6, 2013 at 4:10
  • Well, that's an option too. But, I find that thinking about things in native language improves ones production. Of course, we can think in English too. But then we might be at a disadvantage with native speakers... Commented Jan 6, 2013 at 20:12
  • In my book, a good loanword beats a bad translation any day. There's no advantage in understanding of native-language material (you can't do anything in IT without encountering English words, and in this case the literal meaning is hardly useful for understanding the technical meaning), it would only hurt understanding of foreign-language material (which is the majority of worthwhile material, unless your native language is English). Commented Jan 6, 2013 at 20:19

2 Answers 2

2

As is usually the case, there are no official definitions of these terms. But you could consider, for example, C++'s RAII idiom a form of automatic memory management. And it's quite distinct from reference-counting or garbage-collection.

Sign up to request clarification or add additional context in comments.

2 Comments

You seem to be right. I did not think about that since I assumed that AMM deals only with heap-based objects. But then again, one certainly should consider smart pointers as an AMM technique...
Of course, smart pointers also use reference counts, but they are different from usual reference counting since the count is kept in pointers and not in the objects themselves. However, Wikipedia still sees them as a GC approach. And that really confuses Catfish_Man. The world is so complicated...
1

I think this is more a matter of common usage and reader expectation than precise definition. Sure, any automatic memory management technique "collects garbage", and therefore is a GC. In practice though, if you say "GC", people will assume you're referring to something with more specific properties (typically: nondeterministic finalization, automatic detection of unreferenced objects, ability to collect cycles), and get confused if you're not.

2 Comments

Reference counting is often viewed as GC, and it can be implemented in a deterministic manner...
I'm an ObjC programmer most of the time, so manual refcounting, automatic refcounting, and tracing GC are all available options. Referring to refcounting as GC really confuses things for us :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.